Buildozer with android_new can't create de apk.

419 views
Skip to first unread message

Leonardo Rodriguez

unread,
Oct 23, 2017, 11:55:31 PM10/23/17
to Kivy users support
I was using android but I realize that the old toolchain doesn't work with copy and paste on android, so I tryed with android_new but it doesn't work. This is the last part:

Compiling /home/seven/AndroidProj/MozoMovil/.buildozer/android/platform/build/dists/MozoMovil/private/lib/python2.7/xml/sax/handler.py ...
Compiling /home/seven/AndroidProj/MozoMovil/.buildozer/android/platform/build/dists/MozoMovil/private/lib/python2.7/xml/sax/saxutils.py ...
Compiling /home/seven/AndroidProj/MozoMovil/.buildozer/android/platform/build/dists/MozoMovil/private/lib/python2.7/xml/sax/xmlreader.py ...
[INFO]:    Selecting java build tool:
[INFO]:    Detected highest available build tools version to be 26.0.2
[INFO]:        Building with gradle, as gradle executable is present
[INFO]:    -> running gradlew assembleDebug
           working:                                                                [INFO]:    <- directory context /home/seven/AndroidProj/MozoMovil/.buildozer/android/platform/python-for-android-master
[INFO]:    # Copying APK to current directory
[INFO]:    # APK filename not found in build output, trying to guess
[INFO]:    # Found APK file: /home/seven/AndroidProj/MozoMovil/.buildozer/android/platform/build/dists/MozoMovil/build/outputs/apk/MozoMovil-debug.apk
[INFO]:    # Add version number to APK
[INFO]:    # APK renamed to MozoMovil-0.1-debug.apk
[INFO]:    -> running cp /home/seven/AndroidProj/MozoMovil/.buildozer/android/platform/build/dists/MozoMovil/build/outputs/apk/MozoMovil-debug.apk MozoMovil-0.1-debug.apk
Traceback (most recent call last):                                                                                                                                                                         
  File "/usr/local/bin/buildozer", line 9, in <module>
    load_entry_point('buildozer==0.32', 'console_scripts', 'buildozer')()
  File "/usr/local/lib/python2.7/dist-packages/buildozer/scripts/client.py", line 13, in main
    Buildozer().run_command(sys.argv[1:])
  File "/usr/local/lib/python2.7/dist-packages/buildozer/__init__.py", line 1020, in run_command
    self.target.run_commands(args)
  File "/usr/local/lib/python2.7/dist-packages/buildozer/target.py", line 90, in run_commands
    func(args)
  File "/usr/local/lib/python2.7/dist-packages/buildozer/target.py", line 102, in cmd_debug
    self.buildozer.build()
  File "/usr/local/lib/python2.7/dist-packages/buildozer/__init__.py", line 210, in build
    self.target.build_package()
  File "/usr/local/lib/python2.7/dist-packages/buildozer/targets/android.py", line 765, in build_package
    copyfile(join(dist_dir, 'bin', apk), join(self.buildozer.bin_dir, apk))
  File "/usr/lib/python2.7/shutil.py", line 82, in copyfile
    with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory: u'/home/seven/AndroidProj/MozoMovil/.buildozer/android/platform/build/dists/MozoMovil/bin/MozoMovil-0.1-debug.apk'



I found out that the "cp /home/seven/AndroidProj/MozoMovil/.buildozer/android/platform/build/dists/MozoMovil/build/outputs/apk/MozoMovil-debug.apk MozoMovil-0.1-debug.apk" is not executed, the "MozoMovil-debug.apk" exists on that directory but the MozoMovil-0.1-debug.apk is never created.

Any help will be greatfull.

Thank's
Leo

ZenCODE

unread,
Oct 24, 2017, 10:37:29 AM10/24/17
to Kivy users support
I'm pretty sure this has been fixed on the master branch. I would suggest using the latest dev version and trying again. 'android_new' is now just 'android', and the old toolchain is 'android_old'.

Thanks

Leonardo Rodriguez

unread,
Oct 24, 2017, 11:33:52 AM10/24/17
to Kivy users support
Thank's it is true!, I had an older version of buildozer 0.32, now it creates the apk but it has a new problema, I think it doesn't pack libraries. I get a logcat of the app and it says.

10-24 12:30:42.423 18074 18104 W linker  : /data/data/org.test.mozomovil/files/app/lib/python2.7/site-packages/jnius/jnius.so: is missing DT_SONAME will use basename as a replacement: "jnius.so"
10-24 12:30:42.874 18074 18104 F art     : art/runtime/java_vm_ext.cc:470]   native: #08 pc 0002b7bb  /data/data/org.test.mozomovil/files/app/lib/python2.7/site-packages/jnius/jnius.so (???)
10-24 12:30:42.924 18074 18104 F art     : art/runtime/runtime.cc:403]   native: #12 pc 0002b7bb  /data/data/org.test.mozomovil/files/app/lib/python2.7/site-packages/jnius/jnius.so (???)
10-24 12:30:42.924 18074 18104 F art     : art/runtime/runtime.cc:403]   native: #14 pc 0002b7bb  /data/data/org.test.mozomovil/files/app/lib/python2.7/site-packages/jnius/jnius.so (???)
10-24 12:30:43.055 18109 18109 F DEBUG   :     #13 pc 0002b7bb  /data/data/org.test.mozomovil/files/app/lib/python2.7/site-packages/jnius/jnius.so


Looks like the jnius.so is not packed :(

Thank's in advance.

ZenCODE

unread,
Oct 24, 2017, 2:09:30 PM10/24/17
to Kivy users support
Please could you post the full log? i.e.

    $ buildozer android debug deploy run logcat > out.txt

Then post "out.txt". That will help us see where it's going wrong.

Thanks

Leonardo Rodriguez

unread,
Oct 27, 2017, 5:01:21 PM10/27/17
to Kivy users support
Hi,
   I'm attaching the out.txt, thank's in advance.
out.txt

Leonardo Rodriguez

unread,
Nov 1, 2017, 1:32:10 AM11/1/17
to Kivy users support
Hi, 
   It was something usefull the out.txt? I still can't find the problem.

Thank's

ZenCODE

unread,
Nov 2, 2017, 1:51:35 AM11/2/17
to Kivy users support
There is:

10-10 18:57:58.690  9328  9328 F DEBUG   : Abort message: 'art/runtime/java_vm_ext.cc:470] JNI DETECTED ERROR IN APPLICATION: static jfieldID 0xde8e0014 not valid for class java.lang.Class<org.renpy.android.PythonActivity>'

And an sqlite error? Are you using sqlite? Is it in your requirements in your buildozer.spec file? Try starting from the beginning and just display a label? Once you know you can build a simple app, you know then it's something in the app, not buildozer itself...

Leonardo Rodriguez

unread,
Nov 2, 2017, 2:17:40 PM11/2/17
to Kivy users support
But is very weird, this project was working on the old toolchain but in the old toolchain the copy/paste on Android didn't work so I changed to the new one and suddenly not only the copy/paste works wrong haha. 
It is true, a mini project with a single button works, I will stripe the old one and if I found out what is wrong I will let you know.

Thank's

Leo

Leonardo Rodriguez

unread,
Nov 2, 2017, 2:47:51 PM11/2/17
to Kivy users support
I don't know but the problem is plyer, I was using it because of the gps functionality, I removed it and it works, I still don't know why, keep digging.

Andrew Chernysh

unread,
Jan 10, 2018, 6:17:25 AM1/10/18
to Kivy users support
Hello, ZenCODE!

I have similar problem with generated APK. Seems like Buildozer generates APK file with version in the name but it tries to copy a file WITHOUT it
Im using the latest version of buildozer

-----------------------------------------------------------------------------
[DEBUG]:    BUILD SUCCESSFUL
[DEBUG]:    Total time: 3 seconds
[INFO]:    <- directory context /home/andrew/my_projects/TFWD/.buildozer/android/platform/python-for-android-new-toolchain
[INFO]:    # Copying APK to current directory
[INFO]:    # Found APK file: /home/andrew/my_projects/TFWD/.buildozer/android/platform/build/dists/tfwdapp/bin/TFWD-1-debug.apk
[DEBUG]:   -> running cp /home/andrew/my_projects/TFWD/.buildozer/android/platform/build/dists/tfwdapp/bin/TFWD-1-debug.apk ./
b'Could not find hostpython, will not compile to .pyo (this is normal with python3)\nNo compiled python is present to zip, skipping.\nthis should only be the case if you are using the CrystaX python\n'Traceback (most recent call last):
  File "/usr/local/bin/buildozer", line 11, in <module>
    load_entry_point('buildozer', 'console_scripts', 'buildozer')()
  File "/home/andrew/buildozer/buildozer/scripts/client.py", line 13, in main
    Buildozer().run_command(sys.argv[1:])
  File "/home/andrew/buildozer/buildozer/__init__.py", line 1058, in run_command
    self.target.run_commands(args)
  File "/home/andrew/buildozer/buildozer/target.py", line 92, in run_commands
    func(args)
  File "/home/andrew/buildozer/buildozer/target.py", line 104, in cmd_debug
    self.buildozer.build()
  File "/home/andrew/buildozer/buildozer/__init__.py", line 212, in build
    self.target.build_package()
  File "/home/andrew/buildozer/buildozer/targets/android.py", line 817, in build_package
    copyfile(join(apk_dir, apk), join(self.buildozer.bin_dir, apk_dest))
  File "/usr/lib/python3.5/shutil.py", line 114, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: '/home/andrew/my_projects/TFWD/.buildozer/android/platform/build/dists/tfwdapp/build/outputs/apk/tfwdapp-debug.apk'

-----------------------------------------------------------------------------

вторник, 24 октября 2017 г., 17:37:29 UTC+3 пользователь ZenCODE написал:

ZenCODE

unread,
Jan 10, 2018, 11:02:44 AM1/10/18
to Kivy users support
@Andrew Chernysh

So, the 'android_new' no longer exists with the latest toolchain. It has become just 'android'. That makes it very confusing when one adds to an old post. Please create a new post showing the exact commands you entered and which version of buildozer you are using. And confirm that you have run the:

    $ buildozer android update

command from inside your app folder.

Thanks

Andrew Chernysh

unread,
Jan 11, 2018, 7:42:23 AM1/11/18
to kivy-...@googlegroups.com
I use android command. Like this: buildozer android debug

I also use update command before the debug. It give no visible errors:

---------------------------------------------------------------------------------
# Apache ANT found at /home/andrew/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /home/andrew/.buildozer/android/platform/android-sdk-21
# Android NDK found at /home/andrew/crystax-ndk-10.3.2
# Check application requirements
# Check garden requirements
# Compile platform
# Run '/usr/bin/python3 -m pythonforandroid.toolchain create --dist_name=tfwdapp --bootstrap=sdl2 --requirements=kivy,python3crystax,telethon,pyaes,rsa,pygments,android --arch armeabi-v7a --copy-libs --color=always --storage-dir=/home/andrew/my_projects/TFWD/.buildozer/android/platform/build'
# Cwd /home/andrew/my_projects/TFWD/.buildozer/android/platform/python-for-android-new-toolchain
[INFO]:    Will compile for the following archs: armeabi-v7a
[INFO]:    Found Android API target in $ANDROIDAPI
[INFO]:    Available Android APIs are (18)
[INFO]:    Requested API target 18 is available, continuing.
[INFO]:    Found NDK dir in $ANDROIDNDK
[INFO]:    Got NDK version from $ANDROIDNDKVER
[WARNING]: NDK version was set as r9c, but checking the NDK dir claims it is 10.3.2.
[WARNING]: The build will try to continue, but it may fail and you should check that your setting is correct.
[WARNING]: If the NDK dir result is correct, you don't need to manually set the NDK ver.
[INFO]:    Using Crystax NDK r9c
[INFO]:    Found virtualenv at /usr/local/bin/virtualenv
[INFO]:    Found the following toolchain versions: ['4.9', '5', 'clang3.6', 'clang3.7']
[INFO]:    Picking the latest gcc toolchain, here 5
[WARNING]: Missing executable: autoconf is not installed
[WARNING]: Missing executable: automake is not installed
[WARNING]: Missing executable: libtoolize is not installed
[INFO]:    Of the existing distributions, the following meet the given requirements:
[INFO]:    tfwdapp: includes recipes (hostpython3crystax, sdl2_image, sdl2_mixer, sdl2_ttf, python3crystax, sdl2, six, android, pyjnius, kivy, pyaes, pygments, telethon, rsa), built for archs (armeabi-v7a)
[INFO]:    tfwdapp has compatible recipes, using this one
-------------------------------------------------------------------------------

--
You received this message because you are subscribed to a topic in the Google Groups "Kivy users support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kivy-users/L209GKVlwbU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kivy-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages