Skip to content
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

Support multiple platforms #13

Open
lukpueh opened this issue Feb 6, 2017 · 5 comments
Open

Support multiple platforms #13

lukpueh opened this issue Feb 6, 2017 · 5 comments

Comments

@lukpueh
Copy link
Collaborator

lukpueh commented Feb 6, 2017

Our gradle file is currently configured to build for armeabi-v7a only, i.e. ARM CPU with 32-bit instruction set.

It would be great to support additional architectures, above all ARM/64-bit (which seems to become more and more popular). Here is a list of all supported ABIs.

Building a fat binary that targets multiple architectures should be as easy as adding the desired ABIs to the right line in build.gradle.

Additionally, and this is where it gets tricky, we need a libpython2.7.so for each desired ABI.

Since cross-compling Python for Android is everything but straight-forward I created an example app using kivy's python-for-android, extracted the generated libpython2.7.so and copied it together with the header files into our app.

Back then a quick try to build for anything else but armeabi-v7a failed. It would be worth to try again.

@JustinCappos
Copy link

Can you add some more info about how it actually failed? What was the error / problem?

@lukpueh
Copy link
Collaborator Author

lukpueh commented Feb 7, 2017

Unfortunately not. I greped through my notes but I only jotted down something like: "Tried with --arch=x86, failed, will try later".

Also, the sample app I used back then does not work anymore with current SDK/NDK/p4a versions. I guess the most straight-forward approach, for someone you wants to take care of this ticket, is to go through the kivy docs (link above), copy-paste a new sample app and try again.

@aaaaalbert
Copy link
Owner

Re the @kivy/python-for-android build process: After updating the NDK to r13b, the following --archs work for me:

  • armeabi-v7a (which is what we target for currently)
  • arm64-v84
  • x86
  • x86_64

Neither of the mipses work however, despite the NDK containing populated platforms/android-21/arch-mips* dirs.

Output:

~$ p4a apk --arch=mips --private=/home/lukas/kivy-app --package=org.example.myapp --name "My app" --version 0.1 --requirements=python2,libffi --sdk_dir=$HOME/Android/Sdk --ndk_dir=$HOME/android-ndk-r13b --android_api=21 --ndk_ver=r13b
[INFO]:    This python-for-android revamp is an experimental alpha release!
[INFO]:    It should work (mostly), but you may experience missing features or bugs.
[WARNING]: Asked to compile for no Archs, so failing.

@fmetzger
Copy link

fmetzger commented Feb 9, 2017

TBH, only the two ARM targets are probably of any actual relevance.
AFAIK there might not be a single MIPS Android device currently on the market. x86 might be a bit more interesting, but only marginally. There are one or two actual devices in the wild, as well as projects like Android-x86 or being able to port to Chrome OS (though i don't know any details on that process).

@aaaaalbert
Copy link
Owner

Thanks for the insight. If I remember correctly, we did indeed have a hard time sourcing non-ARM Android handhelds for the lab.

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

4 participants