3

I am thinking of writing a simple app with Python+Kivy, mostly for my own use - nothing fancy. For development, I would like to be able to

  • Compile the app into a package
  • Run it on an Android emulator

Sadly, at the moment I cannot quite close the loop - and googling didn't help.

I believe I downloaded all the relevant tools: Kivy, buildozer, Android SDK. I typed in the Kivy 'hello world' app, and it runs fine without Android emulation - unfortunately, when running it under the emulator (with suggested architecture x86), I get an error INSTALL_FAILED_NO_MATCHING_ABIS. If I make an emulator device with an ARM architecture (which is pretty slow to run), I can at least install the app on the emulated device - but it crashes once loaded. Error message is not informative.

I am guessing somehow I need to build the package for the native x86 architecture (?) which is the recommended default emulator in the Android emulator wizard - is that right? If so, how do I do it with buildozer tool? Or maybe I can run it on the ARM architecture, without it crashing?

Some finer detail:

  • I am running on OSX
  • I am building the package with the suggested command buildozer -v android debug
  • To install the app, I drag it onto the emulator window (there probably is a better way..?)
  • The emulator is the one coming with Android SDK, I'm emulating the default 'Nexus 5X' phone
  • Android SDK version is 23
magiiique
  • 33
  • 1
  • 4

2 Answers2

1

I suggest trying to install the app on a real device and connecting the device to your pc in debug mode and use adb logcat to get the log of the device to know what is causing the error. This way you can make sure if the problem rises from your code or your emulator environment.

Amin Etesamian
  • 3,363
  • 5
  • 27
  • 50
  • My point is indeed to avoid running (possibly broken) code on my phone - it is a bit of an expensive test bed... In any case, the code is just copied from the Kivy 'Hello World' example - so I guess it's fine. – magiiique Sep 10 '16 at 21:57
  • @magiiique check this out http://stackoverflow.com/questions/24572052/install-failed-no-matching-abis-when-install-apk – Amin Etesamian Sep 11 '16 at 04:55
  • Etasamian - yes, that is my problem. But it doesn't explain how to solve it when building with `buildozer` - I don't have visibility of the low-level config files. Or if I do - how do get it? – magiiique Sep 11 '16 at 10:09
  • @magiiique have you tried runnung it with a different device rather than Nexus series? – Amin Etesamian Sep 11 '16 at 12:52
  • No - but would that help, if the problem is the wrong architecture / ABI? – magiiique Sep 11 '16 at 16:34
  • @magiiique try it then. – Amin Etesamian Sep 12 '16 at 07:18
1

Your setup sounds fine, the immediate problem is entirely the architecture (although the crash on your ARM emulator suggests that your app has a bug, which you can debug by checking out the logcat log).

python-for-android supports x86 and will work on the emulator this way. You can use this with --arch=x86. However, buildozer does not currently expose this option (it hardcodes armeabi-v7a). This wouldn't be difficult to fix, feel free to open an issue in the buildozer github repository about it.

I'll note that if you have a device available, debugging using that isn't really any different (or slower/faster) than using the emulator. Buildozer/python-for-android can push the apk and run it automatically, and viewing the logcat output works the same in both cases.

inclement
  • 29,124
  • 4
  • 48
  • 60