Failure to create an APK file

459 views
Skip to first unread message

mostwanted

unread,
Mar 13, 2019, 7:03:59 AM3/13/19
to Kivy users support
When i run buildozer -v android debug command, the command runs well until it reaches a point where i get the error below!

[INFO]:    Building libffi for armeabi-v7a
[INFO]:    -> directory context /home/mostwanted/Desktop/app1/.buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi
[INFO]:    -> running autogen.sh
Exception in thread background thread for pid 13502:
Traceback (most recent call last):
 
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
   
self.run()
 
File "/usr/lib/python2.7/threading.py", line 754, in run
   
self.__target(*self.__args, **self.__kwargs)
 
File "/home/mostwanted/.local/lib/python2.7/site-packages/sh.py", line 1540, in wrap
    fn
(*args, **kwargs)
 
File "/home/mostwanted/.local/lib/python2.7/site-packages/sh.py", line 2459, in background_thread
    handle_exit_code
(exit_code)
 
File "/home/mostwanted/.local/lib/python2.7/site-packages/sh.py", line 2157, in fn
   
return self.command.handle_command_exit_code(exit_code)
 
File "/home/mostwanted/.local/lib/python2.7/site-packages/sh.py", line 815, in handle_command_exit_code
   
raise exc
ErrorReturnCode_127:

  RAN
: /home/mostwanted/Desktop/app1/.buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/autogen.sh

  STDOUT
:
/home/mostwanted/Desktop/app1/.buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/autogen.sh: 2: exec: autoreconf: not found


  STDERR
:


Traceback (most recent call last):
 
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
   
"__main__", fname, loader, pkg_name)
 
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
   
exec code in run_globals
 
File "/home/mostwanted/Desktop/app1/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1081, in <module>
    main
()
 
File "/home/mostwanted/Desktop/app1/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1075, in main
   
ToolchainCL()
 
File "/home/mostwanted/Desktop/app1/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 577, in __init__
    getattr
(self, args.subparser_name.replace('-', '_'))(args)
 
File "/home/mostwanted/Desktop/app1/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 151, in wrapper_func
    build_dist_from_args
(ctx, dist, args)
 
File "/home/mostwanted/Desktop/app1/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 200, in build_dist_from_args
    build_recipes
(build_order, python_modules, ctx)
 
File "pythonforandroid/build.py", line 562, in build_recipes
 
File "/home/mostwanted/Desktop/app1/.buildozer/android/platform/python-for-android/pythonforandroid/recipes/libffi/__init__.py", line 33, in build_arch
    shprint
(sh.Command('./autogen.sh'), _env=env)
 
File "pythonforandroid/logger.py", line 178, in shprint
 
File "/home/mostwanted/.local/lib/python2.7/site-packages/sh.py", line 863, in next
   
self.wait()
 
File "/home/mostwanted/.local/lib/python2.7/site-packages/sh.py", line 792, in wait
   
self.handle_command_exit_code(exit_code)
 
File "/home/mostwanted/.local/lib/python2.7/site-packages/sh.py", line 815, in handle_command_exit_code
   
raise exc
sh
.ErrorReturnCode_127:

  RAN
: /home/mostwanted/Desktop/app1/.buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/autogen.sh

  STDOUT
:
/home/mostwanted/Desktop/app1/.buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/autogen.sh: 2: exec: autoreconf: not found


  STDERR
:

# Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=python3,kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/mostwanted/Desktop/app1/.buildozer/android/platform/build" --ndk-api=21
#
# 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

 What is happening over here? what do i need to do, please help!

Regards Mostwanted

Geo

unread,
Mar 13, 2019, 10:07:22 AM3/13/19
to Kivy users support
Is your code python 3?

mostwanted

unread,
Mar 13, 2019, 11:47:22 AM3/13/19
to Kivy users support
No its python 2
Message has been deleted

mostwanted

unread,
Mar 13, 2019, 12:33:08 PM3/13/19
to Kivy users support
Hey @Geo, I see you were able to create an APK file (https://groups.google.com/forum/#!topic/kivy-users/HMr2NP8Gcuk) How were you able to achieve that? I am stuck and its sad and cold over here, please save me!

Regards

Mostwanted

On Wednesday, March 13, 2019 at 4:07:22 PM UTC+2, Geo wrote:

Robert Flatt

unread,
Mar 13, 2019, 8:43:27 PM3/13/19
to Kivy users support
[INFO]:    -> directory context /home/mostwanted/Desktop/app1/.buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi


So problem occurs in building libffi 

STDOUT:
/home/mostwanted/Desktop/app1/.buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/autogen.sh: 2: exec: autoreconf: not found

So problem is : autoreconf: not found

Looking at the libffi recipe

We see

Requires additional system dependencies on Ubuntu:
 
- `automake` for the `aclocal` binary
 
- `autoconf` for the `autoreconf` binary

Is autoconf installed ?

The way to debug this stuff is to learn to read every line of the log file, and wonder what could that mean?

mostwanted

unread,
Mar 14, 2019, 9:30:23 AM3/14/19
to Kivy users support
I figured that there were a couple of packages i was missing, i installed autoreconf and a couple of others and i was able to create my APK file finally thanks to Robert for encourage me to ponder over my Traceback. But now i am facing a problem with APK file after installing on my phone, when i click on it to istall i get an error called Parse Error (There was a problem while parsing the package),  what could be causing this???

Regards

Mostwanted

Robert Flatt

unread,
Mar 14, 2019, 4:37:42 PM3/14/19
to Kivy users support
I have no clue!

But your friend Google has lots of suggestions to this search "parse error there was a problem while parsing the package"
For example:

Could be all kinds of things, file names, version numbers......

If you have not done so already, try to build and install 'helllo world' with the same build settings.
If there is still a problem, look at the build settings. This will help to put a lower bound on the problem.
Reply all
Reply to author
Forward
0 new messages