Creating a Release APK

295 views
Skip to first unread message

Alessio Rossi

unread,
Nov 26, 2018, 2:31:32 PM11/26/18
to Kivy users support
i try to sign apk with this method but when buildozer finish to work i have a unsigned apk who can help me understund how use this method whit example  https://github.com/kivy/kivy/wiki/Creating-a-Release-APK 

mkdir ~/keystores/

keytool -genkey -v -keystore ~/keystores/dogdog.keystore -alias catcat -keyalg RSA -keysize 2048 -validity 10000

export P4A_RELEASE_KEYSTORE=~/keystores/dogdog.keystore

export P4A_RELEASE_KEYSTORE_PASSWD=dogdog

export P4A_RELEASE_KEYALIAS_PASSWD=catcat

export P4A_RELEASE_KEYALIAS=catcat


cd home/myproject
buildozer -v android release


Thomas S.

unread,
Nov 27, 2018, 3:07:33 PM11/27/18
to Kivy users support
As far as signing the app is concerned I followed the instructions here. Just scroll down to the "Sign your app from command line" section.

You must first create a key: Follow step 1, here. I believe the keytool is found inside your sdk/tools folder, if I remember correctly.  

Assuming you have generated a key, you then export some variables like so:

export P4A_RELEASE_KEYSTORE=~/keystores/<your-new-key>.keystore
export P4A_RELEASE_KEYSTORE_PASSWD=<your-new-key>
export P4A_RELEASE_KEYALIAS_PASSWD=<your-new-key>
export P4A_RELEASE_KEYALIAS=<your-key-alias>

Then: buildozer -v android release to build the app.

I built my app using SDK 23 and build-tools 28.0.3. I placed the .keystore file in the .buildozer/.../bin directory and following step 2 from first link above, I run:

~/.buildozer/android/platform/android-sdk-23/build-tools/28.0.3/zipalign -v 4 myapp-release.apk myapp-release-optimized.apk

and

finally according to step 3 I run:

~/.buildozer/android/platform/android-sdk-23/build-tools/28.0.3/apksigner sign --ks myappname.keystore --out MyApp.apk myapp-release-optimized.apk

where I had to enter the key.

The above worked for me.

Hopefully, the instructions will get you and/or someone else sorted out.

Regards,
Thomas

Alessio Rossi

unread,
Nov 27, 2018, 4:23:54 PM11/27/18
to Kivy users support
Thanks I have resolved but I have new problem, when I developed the apk in Google the api must be 26
The current API target level of my is 19,how update at 26 ? thanks sorry my English regards

Thomas S.

unread,
Nov 27, 2018, 5:28:23 PM11/27/18
to Kivy users support
You should first build the app targeting api 19. Then, delete the dists folder found in the directory .buildozer\android\platform\build. Set api 26 by opening buildozer.spec and make the following change:

# (int) Android API to use
android.api = 26 

Rebuild.

T.S.
Message has been deleted

Alessio Rossi

unread,
Nov 28, 2018, 6:11:59 AM11/28/18
to Kivy users support

Hello i dont have this directory .buildozer\android\platform\
build and i have not directory android or platform.I have directory
/home/kivy/buildozer/build and into build i have a folder lib.linux-x86_64-2.7 i dont kmow what do

 Thx for help Regards


Alessio Rossi

unread,
Nov 28, 2018, 11:09:56 AM11/28/18
to Kivy users support
I have create this apk with python for android https://github.com/kivy/kivy/wiki/Creating-a-Release-APK

Thomas S.

unread,
Nov 28, 2018, 6:43:05 PM11/28/18
to Kivy users support
So did you finally manage to sign the apk?

Alex001

unread,
Nov 29, 2018, 1:23:51 AM11/29/18
to Kivy users support
I have problem with api 19 to upload 26
Reply all
Reply to author
Forward
0 new messages