Skip to content

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

@RobertFlatt

Description

@RobertFlatt

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions