Skip to content

p4a crash "Couldn't find the built APK" #1530

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

Closed
RobertFlatt opened this issue Dec 13, 2018 · 2 comments
Closed

p4a crash "Couldn't find the built APK" #1530

RobertFlatt opened this issue Dec 13, 2018 · 2 comments

Comments

@RobertFlatt
Copy link
Contributor

Versions

  • Python: 3.6
  • OS: Ubuntu 18.04
  • Kivy: N/A
  • Cython: 29.0.1

Description

p4a crashes after gradle build, using master installed here 12/13/2018

Problem is p4a expects gradle output in:

~/.local/share/python-for-android/dists/ex/build/outputs/apk/debug

but gradle creates the .apk in:

~/.local/share/python-for-android/dists/ex/build/outputs/apk

I have no idea why this changed.

The workaround is on line 852 of toolchain.py

                # gradle output apks somewhere else
                # and don't have version in file
                apk_dir = join(dist.dist_dir,
                               "build", "outputs", "apk")
                               #args.build_mode)     ##WORKAROUND remove argument##

buildozer.spec

Command:

p4a apk

Spec file: .p4a

--dist_name=ex
--private .
--package=com.example.ex
--name Ex
--requirements=python3,kivy,android
--arch=armeabi-v7a
--orientation sensor
--sdk_dir /home/me/androidtools/sdk
--ndk_dir /home/me/androidtools/android-ndk-r17c
--ndk_version 17c
--android_api 28
--ndk-api 21
--version 0.0.7

Logs

[INFO]:    Selecting java build tool:
[INFO]:    Detected highest available build tools version to be 28.0.3
[INFO]:        Building with gradle, as gradle executable is present
[INFO]:    -> running gradlew assembleDebug
[INFO]:    <- directory context /mnt/c/users/bobf/documents/pm/tst
[INFO]:    # Copying APK to current directory
[INFO]:    # APK filename not found in build output. Guessing...
Traceback (most recent call last):
  File "/usr/local/bin/p4a", line 11, in <module>
    load_entry_point('python-for-android==0.6.0', 'console_scripts', 'p4a')()
  File "/usr/local/lib/python3.6/dist-packages/pythonforandroid/toolchain.py", line 1031, in main    ToolchainCL()
  File "/usr/local/lib/python3.6/dist-packages/pythonforandroid/toolchain.py", line 551, in __init__    getattr(self, args.subparser_name.replace('-', '_'))(args)
  File "/usr/local/lib/python3.6/dist-packages/pythonforandroid/toolchain.py", line 150, in wrapper_func    func(self, args)
  File "/usr/local/lib/python3.6/dist-packages/pythonforandroid/toolchain.py", line 897, in apk    raise ValueError('Couldn\'t find the built APK')
ValueError: Couldn't find the built APK
@ghost
Copy link

ghost commented Dec 13, 2018

Did you build completely fresh, removing your old distribution?

New distributions will have a newer gradle, where the output path is indeed different. But if you're building an existing older distribution with the old gradle still lying around, that might be the problem.

@RobertFlatt
Copy link
Contributor Author

--clean_all and reinstall p4a fixed the problem.
Gradle version makes sense to me.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant