-
Notifications
You must be signed in to change notification settings - Fork 504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
not able to release apk in release mode - build failed #363
Comments
i have set variable on terminal, and now i am able to create the release apk, however it is unasign.... :( so i did the asing manually, however the apk does not run. export P4A_RELEASE_KEYSTORE=keystores/lotoguess-release-key.keystore my manually script to asing #!/bin/bash select FILENAME in $(ls /home/gustavo/jaspion/bin/*.apk | grep -i release) echo "voce escolheu a apk -> "$FILENAME VERSION=$(echo $FILENAME | awk '{sub(/-release./,""); print}' | awk '{sub(/.-/,""); print}') KEYSTORE=/home/gustavo/jaspion/keystores/lotoguess-release-key.keystore echo $KEYSTORE echo "validando zipalign" echo rm $FILENAME |
I have the same issue. |
@ecdsa, Were you able to resolve this issue? I'm hitting it as well. |
@bearnun it is not resolved, but I can still create an apk. |
@ecdsa How can i pass to buildozer the keystore password? |
Running into this as well. Currently I'm relying on my own mechanism for signing my .apk. is there a way to have buildozer build a release apk and not sign it? |
I've got same problem. Please anybody comment the solution. Thanks |
What I've done since is change my build process to pass the signing information to buildozer by setting the appropriate environment variables: export P4A_RELEASE_KEYSTORE=((path to your keystore)) Switching to this approach ended up working for me. |
FWIW this is documented here: |
@brentpicass but how to change build process? How to edit the setting? Thanks. |
@brentpicass, this is what worked for me: |
@AndreMiras is there any videos about this? or can you explain it more precisely? |
Well I'm not too sure what to add. |
@AndreMiras @inclement In kivy documentation it's mentioned like this:
My question is,
|
Generating the artifacts for signing an APK is an Android level process, separate from Kivy. The assumption is you already have the signing certificate + key, or you know how to do it already. There is some good information out there already - here's one place in the Android developer documentation: |
@brentpicasso Your assumption is wrong and I don't know how to do it already, and as I'm using kivy I expected a detailed official documentation/tutorial from their website but didn't find any, so honestly I'm losing interest in it. Yes I understand it's a separate process but that doesn't mean a detailed docs will cause any harm. |
@kowsar89 I think that instruction page was just a draft. It's indeed no very furnished or up to date, but at least it's there. It was a good start for me to know where to look. And it's also our duty to contribute and improve it. I've just updated with the link to the official documentation @brentpicasso shared. Regarding your questions, see my answers below and as you ramp up feel free to update the wiki :)
This is what I did:
As I understood it's just as string to identify your keystore. I use "release" or "debug" as alias names.
I'm not sure what you mean here. But in my setup my app dependencies are installed in the virtualenv, but it doesn't matter because Regarding the wiki doc, I personally ended up forking my own and updating only my project documentation, because I didn't dare to update their wiki for things I wasn't sure of. But it indeed feels like some things are outdated lile:
Don't feel discouraged, it indeed requires time to get into it, but keep in mind Kivy is not a commercial product. And it's not something I would really recommend for production anyway. I personally see it more as a toy (no offence guys :p). So play with it and have fun! |
@AndreMiras |
As far as I'm concerned, https://developer.android.com/studio/publish/app-signing.html#signing-manually is the official documentation - there is basically no difference here between how to do it for a Kivy app or a Java app. In particular, you can follow the steps in 'Build an unsigned APK and sign it manually', except you can skip step 1 because you already have the APK. A more detailed explanation of this would be welcome in the python-for-android docs. I hadn't noticed there isn't much, although that's partly because I haven't seen it mentioned for a while. This issue thread appears to originally describe a more specific problem with how python-for-android behaves. I thought this was fixed, and that the current behaviour would be to build a release APK without signing (which is the intended result). Is this what happens with |
No, I think running
From the keytool manual:
So yes this is how I've generated my key. |
Sorry, I meant that it should run (and produce an unsigned apk) by default if these variables are not provided. That was the reason for this original bug - it would crash instead of proceeding without signing if the variables weren't set. |
Ah OK, so yes then it still crashes the application if the variables are not provided, see truncated output trace below.
So in this case the error was:
If I set this variable and run it again, it will fail again with the other missing variables. |
Okay, thanks. It looks like I did fix this in p4a, and it will only assume that the variables exist if passed the Probably this line should be removed, and added as an option somehow. |
Also related to #851 |
Probably fixed in previous commit plus #835 |
That key should be gotten automatically, the best recommendation is, Delete the the .buildozer directory completely, then cd to the directory where your project is, then buildozer -v android debug |
I am trying to release my apk without success using android_new option.
Whenever i try to build in release mode it crash... on debug mode i have success.
Someone can help me? I dont know what is this env.P4A_RELEASE_KEYSTORE variable... I tried to set in .spec, without sucess
output
gustavo@gustavo-VirtualBox:
/jaspion$ buildozer --version/jaspion$Check configuration tokens
Buildozer 0.33dev
gustavo@gustavo-VirtualBox:
`INFO: lotoguess2 has compatible recipes, using this one
INFO: -> directory context /home/gustavo/jaspion/.buildozer/android/platform/build/dists/lotoguess2
INFO: -> running ant release
working: BUILD FAILED INFO: STDOUT (last 20 lines of 111):
[aapt](skipping file)
-package:
[apkbuilder] Current build type is different than previous build: forced apkbuilder run.
[apkbuilder] Creating LotoGuess-1.0.2-release-unsigned.apk for release...
-post-package:
-release-prompt-for-password:
-release-nosign:
-release-sign:
[echo] Signing final apk...
BUILD FAILED
/home/gustavo/.buildozer/android/platform/android-sdk-20/tools/ant/build.xml:1135: The following error occurred while executing this line:
/home/gustavo/.buildozer/android/platform/android-sdk-20/tools/ant/build.xml:1147: /home/gustavo/jaspion/.buildozer/android/platform/build/dists/lotoguess2/${env.P4A_RELEASE_KEYSTORE} (No such file or directory)
Total time: 14 seconds
cd /home/gustavo/jaspion/.buildozer/android/platform/build/dists/lotoguess2 && /home/gustavo/.buildozer/android/platform/apache-ant-1.9.4/bin/ant release
[WARNING]: ERROR: /home/gustavo/.buildozer/android/platform/apache-ant-1.9.4/bin/ant failed!
Command failed: python -m pythonforandroid.toolchain --color=always --storage-dir=/home/gustavo/jaspion/.buildozer/android/platform/build apk --bootstrap=sdl2 --dist_name lotoguess2 --name 'Loto Guess' --version 1.0.2 --package com.gmftech.lotoguess2 --android_api 19 --minsdk 14 --private /home/gustavo/jaspion/.buildozer/android/app --permission CAMERA --permission INTERNET --permission ACCESS_NETWORK_STATE --permission WRITE_EXTERNAL_STORAGE --add-jar /home/gustavo/jaspion/lib-jars/AdBuddiz-KivyPlugin-3.1.11.jar --presplash /home/gustavo/jaspion/./data/lotto_icon.png --icon /home/gustavo/jaspion/./data/icon_verde.png --orientation portrait --release --copy-libs
Buildozer failed to execute the last command
The error might be hidden in the log above this error
Please read the full log, and search for it before
raising an issue with buildozer itself.
In case of a bug report, please add a full log with log_level = 2
`
Spec:
[app]
sudo pip install https://github.com/kivy/buildozer/archive/master.zip
(str) Title of your application
title = Loto Guess
(str) Package name
package.name = lotoguess2
(str) Package domain (needed for android/ios packaging)
package.domain = com.gmftech
(str) Source code where the main.py live
source.dir = .
(list) Source files to include (let empty to include all the files)
source.include_exts = py,png,jpg,kv,atlas,ttf,mo
(list) List of inclusions using pattern matching
source.include_patterns = assets/,images/.png
(list) Source files to exclude (let empty to not exclude anything)
source.exclude_exts = spec
(list) List of directory to exclude (let empty to not exclude anything)
source.exclude_dirs = tests, bin
(list) List of exclusions using pattern matching
source.exclude_patterns = license,images//.jpg
(str) Application versioning (method 1)
version = 1.0.2
(str) Application versioning (method 2)
version.regex = version = '"['"]
version.filename = %(source.dir)s/main.py
(list) Application requirements
comma seperated e.g. requirements = sqlite3,kivy
requirements = kivy,jinja2,openssl,requests,simplejson
kivy==master
(str) Custom source folders for requirements
Sets custom source for any requirements with recipes
requirements.source.kivy = ../../kivy
(list) Garden requirements
garden_requirements = recycleview
(str) Presplash of the application
presplash.filename = %(source.dir)s/data/lotto_icon.png
presplash.filename = %(source.dir)s/data/Lucky_Coin.png
presplash.filename = %(source.dir)s/data/loading.png
(str) Icon of the application
icon.filename = %(source.dir)s/data/icon_verde.png
(str) Supported orientation (one of landscape, portrait or all)
orientation = portrait
(list) List of service to declare
services = NAME:ENTRYPOINT_TO_PY,NAME2:ENTRYPOINT2_TO_PY
OSX Specific
author = © Copyright Info
Android specific
(bool) Indicate if the application should be fullscreen or not
fullscreen = 1
(list) Permissions
android.permissions = CAMERA,INTERNET,ACCESS_NETWORK_STATE,WRITE_EXTERNAL_STORAGE
,ACCESS_FINE_LOCATION,ACCESS_COARSE_LOCATION
(int) Android API to use
android.api = 19
(int) Minimum API required
android.minapi = 14
(int) Android SDK version to use
android.sdk = 23
(str) Android NDK version to use
android.ndk = 10e
(bool) Use --private data storage (True) or --dir public storage (False)
android.private_storage = True
(str) Android NDK directory (if empty, it will be automatically downloaded.)
android.ndk_path = /home/gustavo/crystax-ndk-10.3.1
(str) Android SDK directory (if empty, it will be automatically downloaded.)
android.sdk_path =
(str) ANT directory (if empty, it will be automatically downloaded.)
android.ant_path =
(str) python-for-android git clone directory (if empty, it will be automatically cloned from github)
android.p4a_dir = /home/gustavo/python-for-android
(list) python-for-android whitelist
android.p4a_whitelist =
(bool) If True, then skip trying to update the Android sdk
This can be useful to avoid excess Internet downloads or save time
when an update is due and you just want to test/build your package
android.skip_update = False
(str) Bootstrap to use for android builds (android_new only)
android.bootstrap = sdl2
(str) Android entry point, default is ok for Kivy-based app
android.entrypoint = org.renpy.android.PythonActivity
(list) List of Java .jar files to add to the libs so that pyjnius can access
their classes. Don't add jars that you do not need, since extra jars can slow
down the build process. Allows wildcards matching, for example:
OUYA-ODK/libs/*.jar
android.add_jars = foo.jar,bar.jar,path/to/more/*.jar
android.add_jars = lib-jars/*.jar
P4A_RELEASE_KEYSTORE = keystores/lotoguess-release-key.keystore
(list) List of Java files to add to the android project (can be java or a
directory containing the files)
android.add_src =
(str) python-for-android branch to use, if not master, useful to try
not yet merged features.
android.branch = master
(str) OUYA Console category. Should be one of GAME or APP
If you leave this blank, OUYA support will not be enabled
android.ouya.category = GAME
(str) Filename of OUYA Console icon. It must be a 732x412 png image.
android.ouya.icon.filename = %(source.dir)s/data/ouya_icon.png
(str) XML file to include as an intent filters in tag
android.manifest.intent_filters =
(list) Android additionnal libraries to copy into libs/armeabi
android.add_libs_armeabi = libs/android/*.so
android.add_libs_armeabi_v7a = libs/android-v7/*.so
android.add_libs_x86 = libs/android-x86/*.so
android.add_libs_mips = libs/android-mips/*.so
(bool) Indicate whether the screen should stay on
Don't forget to add the WAKE_LOCK permission if you set this to True
android.wakelock = False
(list) Android application meta-data to set (key=value format)
android.meta_data =
(list) Android library project to add (will be added in the
project.properties automatically.)
android.library_references =
android.meta_data = com.google.android.gms.version=@integer/google_play_services_version
android.library_references = google-play-services_lib
(str) Android logcat filters to use
android.logcat_filters = *:S python:D
(bool) Copy library instead of making a libpymodules.so
android.copy_libs = 1
iOS specific
(str) Path to a custom kivy-ios folder
ios.kivy_ios_dir = ../kivy-ios
(str) Name of the certificate to use for signing the debug version
Get a list of available identities: buildozer ios list_identities
ios.codesign.debug = "iPhone Developer: ()"
(str) Name of the certificate to use for signing the release version
ios.codesign.release = %(ios.codesign.debug)s
[buildozer]
(int) Log level (0 = error only, 1 = info, 2 = debug (with command output))
log_level = 2
(int) Display warning if buildozer is run as root (0 = False, 1 = True)
warn_on_root = 1
(str) Path to build artifact storage, absolute or relative to spec file
build_dir = ./.buildozer
(str) Path to build output (i.e. .apk, .ipa) storage
bin_dir = ./bin
-----------------------------------------------------------------------------
List as sections
You can define all the "list" as [section:key].
Each line will be considered as a option to the list.
Let's take [app] / source.exclude_patterns.
Instead of doing:
[app]
source.exclude_patterns = license,data/audio/.wav,data/images/original/
This can be translated into:
[app:source.exclude_patterns]
license
data/audio/*.wav
data/images/original/*
-----------------------------------------------------------------------------
Profiles
You can extend section / key with a profile
For example, you want to deploy a demo version of your application without
HD content. You could first change the title to add "(demo)" in the name
and extend the excluded directories to remove the HD content.
[app@demo]
title = My Application (demo)
[app:source.exclude_patterns@demo]
images/hd/*
Then, invoke the command line with the "demo" profile:
buildozer --profile demo android debug
The text was updated successfully, but these errors were encountered: