-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
App build failing on MacOS #1647
Comments
Thanks for the clear report. Looks like the issue is I'm trying this buildozer.spec locally just in case it's reproducible, but I've been doing successful builds all day so I'm not too hopeful. |
Yep, confirmed that I can't reproduce this locally using the same buildozer.spec. I think this is a macOS bug. |
That's unfortunate, I may need to set up (reluctantly) a VM to get a build done in the mean time. That in itself will likely have me bald lol. Well my fingers are crossed for a quick and easy fix 🤞 Thanks for checking it out 👍 |
I'm semi-optimistic that it will be fixed quickly, it just needs someone who can reproduce it to look into it. |
Ok so I though I'd give ndk r16b a go as that's what I've used successfully in the past. The build still fails but its a different error. I have no idea if this confuses matter more or helps narrow it down but below is the logs python 2 - https://paste.city/133 python 3 - https://paste.city/132 config.log (assuming this is the one as I could only find 2 and the other one had exit code 0) - https://paste.city/134 |
Yes that
So it looks like you're missing the lib atomic. Could you try to link it then with |
its not something I've done before, how would I go about that? Unfortunately my skills extend to some python :) |
Ahah sure I can understand, that's how I started hacking around in p4a. |
I tried that with no joy. to be honest I think its probably not worth while looking into the error on the 16b ndk as the 17c is newer and recommended. so hopefully someone with the knowledge has a Mac lol. |
I've been bashing my head against the same issue today. Haven't figured it out, but maybe some info would be relevant to someone else here. The exact command that is failing is in the
I tried to manually augment the command by adding a link to the place I knew my python static lib to exist: I validated that the library actually had matching references to the undefined references, i.e.
(However, the names don't seem to match exactly -- note the underscore) I'm trying to roll back and see if a previous build step is pulling in a different step that didn't link correctly but haven't quite found it yet, and I haven't figured out where I can manually inject an extra LDFLAG to see if that would even push me past this. There's another breadcrumb if I scroll back to the actual place in the compilation that failed,
Which suggests I may want to look at another NDK version, as this one may just be bugged. So I modified my Will update if I get any further. |
This is actually not the way forward, you need to -L the directory containing the libpython3.7m.so built by python-for-android. Would you be able to paste the command that python-for-android ran to result in this error? I'd like to see what it specifies, and would also be good if you could check what's in the -L directories there.
Also just to note, this is okay and doesn't matter, no version of the NDK will give any different message as far as I know. |
@inclement I will try it. |
Does not seem to resolve. I cloned that fork and
Attempted on |
@inclement Didn't work here either. only had time to try py2 unfortunately., will try py3 later |
@OptimusGREEN, thanks for the testing and to post the Your log should contain this words: ...I checked the p4a's patching code and it seems right to me ( https://github.com/kivy/python-for-android/blob/master/pythonforandroid/patching.py#L16-L23 )...and it has been there for a while...and still applies to linux platform...:thinking::
If you are absolutely certain that you made the test right, please...can you give us the result of the python's command I mention above? |
Hi, I'll give it another go later tonight but what I actually did was copy pasted the 5 or so files in your pr to a fresh download of master. I've not sussed out how to test pr's the proper way lol. Feel free to advise 🤪 ps: os.uname()[0] does indeed return 'Darwin' |
@opacam I've done it properly this time I think. found out how to add a pr in gitkraken.
py2 - https://paste.city/146 Feel free to give me a shout if you need me to do anything else. |
Kivy Python to Android Issue 3/3/2019 I running to the same issue described above where ld cannot find python3.7m. $ buildozer android debug ============================================================================================== My Environment: Macbook Pro 2017 15:11 $ sw_vers 15:13 $ python 15:16 $ python3
15:18 $ Kivy3 16:02 $ which python3.7m ============================================================================================== Building with one Python file, main.py, from the kivy.org YouTube tutorial 2: kivy.org Tutorial 2: Building an android apkhttps://www.youtube.com/watch?v=t8N_8WkALdE&list=PLdNh1e1kmiPP4YApJm8ENK2yMlwF1_edq&index=2Scatter allows drag and drop without any additional programmingBuilding an Android Appfrom kivy.app import App class TutorialApp(App): if name == 'main': ============================================================================================== buildozer.spec file in same directory as main.py: [app] (str) Title of your applicationtitle = Test Kivy App 1 (str) Package namepackage.name = testkivy1 (str) Package domain (needed for android/ios packaging)package.domain = org.test (str) Source code where the main.py livesource.dir = . (list) Source files to include (let empty to include all the files)source.include_exts = py,png,jpg,kv,atlas (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 (str) Application versioning (method 2)version.regex = version = '"['"]version.filename = %(source.dir)s/main.py(list) Application requirementscomma separated e.g. requirements = sqlite3,kivyrequirements = python3,kivy (str) Custom source folders for requirementsSets custom source for any requirements with recipesrequirements.source.kivy = ../../kivy(list) Garden requirements#garden_requirements = (str) Presplash of the application#presplash.filename = %(source.dir)s/data/presplash.png (str) Icon of the application#icon.filename = %(source.dir)s/data/icon.png (str) Supported orientation (one of landscape, sensorLandscape, portrait or all)orientation = all (list) List of service to declare#services = NAME:ENTRYPOINT_TO_PY,NAME2:ENTRYPOINT2_TO_PY OSX Specificauthor = © Copyright Infochange the major version of python used by the apposx.python_version = 3 Kivy version to useosx.kivy_version = 1.10.1 Android specific(bool) Indicate if the application should be fullscreen or notfullscreen = 1 (string) Presplash background color (for new android toolchain)Supported formats are: #RRGGBB #AARRGGBB or one of the following names:red, blue, green, black, white, gray, cyan, magenta, yellow, lightgray,darkgray, grey, lightgrey, darkgrey, aqua, fuchsia, lime, maroon, navy,olive, purple, silver, teal.#android.presplash_color = #FFFFFF (list) Permissions#android.permissions = INTERNET (int) Target Android API, should be as high as possible.#android.api = 27 (int) Minimum API your APK will support.#android.minapi = 21 (int) Android SDK version to use#android.sdk = 20 (str) Android NDK version to use#android.ndk = 17c (int) Android NDK API to use. This is the minimum API your app will support, it should usually match android.minapi.#android.ndk_api = 21 (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 = (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 = (bool) If True, then skip trying to update the Android sdkThis can be useful to avoid excess Internet downloads or save timewhen an update is due and you just want to test/build your packageandroid.skip_update = False(bool) If True, then automatically accept SDK licenseagreements. This is intended for automation only. If set to False,the default, you will be shown the license when first runningbuildozer.android.accept_sdk_license = False(str) Android entry point, default is ok for Kivy-based app#android.entrypoint = org.renpy.android.PythonActivity (list) Pattern to whitelist for the whole project#android.whitelist = (str) Path to a custom whitelist file#android.whitelist_src = (str) Path to a custom blacklist file#android.blacklist_src = (list) List of Java .jar files to add to the libs so that pyjnius can accesstheir classes. Don't add jars that you do not need, since extra jars can slowdown the build process. Allows wildcards matching, for example:OUYA-ODK/libs/*.jar#android.add_jars = foo.jar,bar.jar,path/to/more/*.jar (list) List of Java files to add to the android project (can be java or adirectory containing the files)#android.add_src = (list) Android AAR archives to add (currently works only with sdl2_gradlebootstrap)#android.add_aars = (list) Gradle dependencies to add (currently works only with sdl2_gradlebootstrap)#android.gradle_dependencies = (list) Java classes to add as activities to the manifest.#android.add_activites = com.example.ExampleActivity (str) python-for-android branch to use, defaults to master#p4a.branch = master (str) OUYA Console category. Should be one of GAME or APPIf 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 = (str) launchMode to set for the main activity#android.manifest.launch_mode = standard (list) Android additional libraries to copy into libs/armeabi#android.add_libs_armeabi = libs/android/.so (bool) Indicate whether the screen should stay onDon'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 theproject.properties automatically.)#android.library_references = (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 (str) The Android arch to build for, choices: armeabi-v7a, arm64-v8a, x86android.arch = armeabi-v7a Python for android (p4a) specific(str) python-for-android git clone directory (if empty, it will be automatically cloned from github)#p4a.source_dir = (str) The directory in which python-for-android should look for your own build recipes (if any)#p4a.local_recipes = (str) Filename to the hook for p4a#p4a.hook = (str) Bootstrap to use for android buildsp4a.bootstrap = sdl2(int) port number to specify an explicit --port= p4a argument (eg for bootstrap flask)#p4a.port = iOS specific(str) Path to a custom kivy-ios folder#ios.kivy_ios_dir = ../kivy-ios Alternately, specify the URL and branch of a git checkout:ios.kivy_ios_url = https://github.com/kivy/kivy-ios Another platform dependency: ios-deployUncomment to use a custom checkout#ios.ios_deploy_dir = ../ios_deploy Or specify URL and branchios.ios_deploy_url = https://github.com/phonegap/ios-deploy (str) Name of the certificate to use for signing the debug versionGet 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 filebuild_dir = ./.buildozer(str) Path to build output (i.e. .apk, .ipa) storagebin_dir = ./bin-----------------------------------------------------------------------------List as sectionsYou 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] This can be translated into:#[app:source.exclude_patterns] -----------------------------------------------------------------------------ProfilesYou can extend section / key with a profileFor example, you want to deploy a demo version of your application withoutHD content. You could first change the title to add "(demo)" in the nameand extend the excluded directories to remove the HD content.#[app@demo] #[app:source.exclude_patterns@demo] Then, invoke the command line with the "demo" profile:#buildozer --profile demo android debug ============================================================================================== 15:29 $ buildozer android debug Check configuration tokensEnsure build layoutCreate directory /Users/mark/kivy_examples/kivy-org-yt-t2-android-apk/.buildozerCreate directory /Users/mark/kivy_examples/kivy-org-yt-t2-android-apk/binCreate directory /Users/mark/kivy_examples/kivy-org-yt-t2-android-apk/.buildozer/applibsCreate directory /Users/mark/kivy_examples/kivy-org-yt-t2-android-apk/.buildozer/android/platformCreate directory /Users/mark/kivy_examples/kivy-org-yt-t2-android-apk/.buildozer/android/appCheck configuration tokensRead available permissions from api-versions.xmlPreparing buildCheck requirements for androidSearch for Git (git)-> found at /usr/local/Cellar/git/2.20.1/bin/gitSearch for Cython (cython)-> found at /usr/local/bin/cythonSearch for Java compiler (javac)-> found at /System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/javacSearch for Java keytool (keytool)-> found at /System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/keytoolInstall platformRun 'git clone -b master --single-branch https://github.com/kivy/python-for-android.git python-for-android'Cwd /Users/mark/kivy_examples/kivy-org-yt-t2-android-apk/.buildozer/android/platformCloning into 'python-for-android'... Run '/usr/local/opt/python/bin/python3.7 -m pip install -q --user 'appdirs' 'colorama>=0.3.3' 'jinja2' 'six' 'enum34; python_version<"3.4"' 'sh>=1.10; sys_platform!="nt"''Cwd NoneApache ANT found at /Users/mark/.buildozer/android/platform/apache-ant-1.9.4Android SDK found at /Users/mark/.buildozer/android/platform/android-sdkAndroid NDK found at /Users/mark/.buildozer/android/platform/android-ndk-r17cInstalling/updating SDK platform tools if necessaryRun '/Users/mark/.buildozer/android/platform/android-sdk/tools/bin/sdkmanager tools platform-tools'Cwd /Users/mark/.buildozer/android/platform/android-sdk[=======================================] 100% Computing updates... Run '/Users/mark/.buildozer/android/platform/android-sdk/tools/bin/sdkmanager --update'Cwd /Users/mark/.buildozer/android/platform/android-sdk[=======================================] 100% Computing updates... Updating SDK build tools if necessaryRun '/Users/mark/.buildozer/android/platform/android-sdk/tools/bin/sdkmanager --list'Cwd /Users/mark/.buildozer/android/platform/android-sdkInstalled packages:=====================] 100% Computing updates...
Available Packages:
Check that aidl can be executedSearch for AidlRun '/Users/mark/.buildozer/android/platform/android-sdk/build-tools/28.0.3/aidl'Cwd NoneDownloading platform api target if necessaryAndroid packages installation done.Check application requirementsCheck garden requirementsCompile platformRun '/usr/local/opt/python/bin/python3.7 -m pythonforandroid.toolchain create --dist_name=testkivy1 --bootstrap=sdl2 --requirements=python3,kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir="/Users/mark/kivy_examples/kivy-org-yt-t2-android-apk/.buildozer/android/platform/build" --ndk-api=21'Cwd /Users/mark/kivy_examples/kivy-org-yt-t2-android-apk/.buildozer/android/platform/python-for-android/Users/mark/kivy_examples/kivy-org-yt-t2-android-apk/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py:83: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses RAN: /usr/bin/make -j5 libffi.la STDOUT: STDERR: [INFO]: make libffi.la failed as expected RAN: /Users/mark/.buildozer/android/platform/android-ndk-r17c/ndk-build V=1 STDOUT: define LOOKUP_T const ogg_int32_t
In file included from /Users/mark/kivy_examples/kivy-org-yt-t2-android-apk/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni/SDL2_mixer/external/libvorbisidec-1.2.1/mdct.c:39: define LOOKUP_T const ogg_int32_t
2 warnings generated. define LOOKUP_T const ogg_int32_t
In file included from /Users/mark/kivy_examples/kivy-org-yt-t2-android-apk/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni/SDL2_mixer/external/libvorbisidec-1.2.1/window.c:22: define LOOKUP_T const ogg_int32_t
In file included from /Users/mark/kivy_examples/kivy-org-yt-t2-android-apk/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni/SDL2_mixer/external/libvorbisidec-1.2.1/window.c:22: define LOOKUP_T const ogg_int32_t
In file included from /Users/mark/kivy_examples/kivy-org-yt-t2-android-apk/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni/SDL2_mixer/external/libvorbisidec-1.2.1/window.c:22: define LOOKUP_T const ogg_int32_t
In file included from /Users/mark/kivy_examples/kivy-org-yt-t2-android-apk/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni/SDL2_mixer/external/libvorbisidec-1.2.1/window.c:22: define LOOKUP_T const ogg_int32_t
In file included from /Users/mark/kivy_examples/kivy-org-yt-t2-android-apk/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni/SDL2_mixer/external/libvorbisidec-1.2.1/window.c:22: define LOOKUP_T const ogg_int32_t
In file included from /Users/mark/kivy_examples/kivy-org-yt-t2-android-apk/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni/SDL2_mixer/external/libvorbisidec-1.2.1/window.c:22: define LOOKUP_T const ogg_int32_t
In file included from /Users/mark/kivy_examples/kivy-org-yt-t2-android-apk/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni/SDL2_mixer/external/libvorbisidec-1.2.1/window.c:22: define LOOKUP_T const ogg_int32_t
8 warnings generated. /Users/mark/.buildozer/android/platform/android-ndk-r17c/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lpython3.7m /Users/mark/kivy_examples/kivy-org-yt-t2-android-apk/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni/application/src/start.c:51: error: undefined reference to 'PyModule_Create2' STDERR: Traceback (most recent call last): RAN: /Users/mark/.buildozer/android/platform/android-ndk-r17c/ndk-build V=1 STDOUT: define LOOKUP_T const ogg_int32_t
In file included from /Users/mark/kivy_examples/kivy-org-yt-t2-android-apk/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni/SDL2_mixer/external/libvorbisidec-1.2.1/mdct.c:39: define LOOKUP_T const ogg_int32_t
2 warnings generated. define LOOKUP_T const ogg_int32_t
In file included from /Users/mark/kivy_examples/kivy-org-yt-t2-android-apk/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni/SDL2_mixer/external/libvorbisidec-1.2.1/window.c:22: define LOOKUP_T const ogg_int32_t
In file included from /Users/mark/kivy_examples/kivy-org-yt-t2-android-apk/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni/SDL2_mixer/external/libvorbisidec-1.2.1/window.c:22: define LOOKUP_T const ogg_int32_t
In file included from /Users/mark/kivy_examples/kivy-org-yt-t2-android-apk/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni/SDL2_mixer/external/libvorbisidec-1.2.1/window.c:22: define LOOKUP_T const ogg_int32_t
In file included from /Users/mark/kivy_examples/kivy-org-yt-t2-android-apk/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni/SDL2_mixer/external/libvorbisidec-1.2.1/window.c:22: define LOOKUP_T const ogg_int32_t
In file included from /Users/mark/kivy_examples/kivy-org-yt-t2-android-apk/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni/SDL2_mixer/external/libvorbisidec-1.2.1/window.c:22: define LOOKUP_T const ogg_int32_t
In file included from /Users/mark/kivy_examples/kivy-org-yt-t2-android-apk/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni/SDL2_mixer/external/libvorbisidec-1.2.1/window.c:22: define LOOKUP_T const ogg_int32_t
In file included from /Users/mark/kivy_examples/kivy-org-yt-t2-android-apk/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni/SDL2_mixer/external/libvorbisidec-1.2.1/window.c:22: define LOOKUP_T const ogg_int32_t
8 warnings generated. /Users/mark/.buildozer/android/platform/android-ndk-r17c/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lpython3.7m /Users/mark/kivy_examples/kivy-org-yt-t2-android-apk/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni/application/src/start.c:51: error: undefined reference to 'PyModule_Create2' STDERR: Command failed: /usr/local/opt/python/bin/python3.7 -m pythonforandroid.toolchain create --dist_name=testkivy1 --bootstrap=sdl2 --requirements=python3,kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir="/Users/mark/kivy_examples/kivy-org-yt-t2-android-apk/.buildozer/android/platform/build" --ndk-api=21Buildozer failed to execute the last commandThe error might be hidden in the log above this errorPlease read the full log, and search for it beforeraising an issue with buildozer itself.In case of a bug report, please add a full log with log_level = 2 |
I don't know if this might be useful. https://github.com/kivy/kivy/issues/6196 |
I am having this issue for more than 2 months earlier and haven't found solution to this. PFA the logs for reference. |
It turns out that the generated binary for MacOS is not `python`...its `python.exe` See also: https://github.com/python/cpython/blob/3.7/README.rst#build-instructions Closes: kivy#1817 Closes: kivy#1800 Closes: kivy#1682 Closes: kivy#1647
Versions
Description
App fails to build and seems to error out at the "doing some hacky stuff" point.
buildozer.spec
Command:
Spec file:
Logs
It wouldn't let me paste even one of the logs as too long.
Python 2 error here: https://paste.city/129
Python 3 error here: https://paste.city/128
The text was updated successfully, but these errors were encountered: