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

WIP: Api level 28, NDK 17c - Recipe Updates and Fixes #1381

Closed
wants to merge 77 commits into from
Closed

WIP: Api level 28, NDK 17c - Recipe Updates and Fixes #1381

wants to merge 77 commits into from

Conversation

rnixx
Copy link
Member

@rnixx rnixx commented Sep 25, 2018

This PR contains changes necessary to build with API level 28 and python 2 and relates to #1219

It also contains changes from https://github.com/kivy/python-for-android/compare/set_app_platform_19, which should be generalized according to @tito and @inclement

The new patches contained in python2 recipe prevent the use of ctermid and setpwent, which are missing in bionic lib and caused System.err: dlopen failed: cannot locate symbol. Nevertheless, controlling this via HAVE_CTERMID and HAVE_GETPWENT in pyconfig.h would be the cleaner solution. I just have no idea how to control this via autoconf/autoheader in python build.

UPDATE Added another patch to disable large file support when compiling python 2. This is needed to prevent ftello64 error on Android < 7.

The following recipes have been added:

  • asn1crypto
  • attrs
  • pyasn1_modules
  • service_identity

UPDATE: asn1crypto, attrs, pyasn1_modules and service_identity have been removed again. Need to be defined in requirements of buildozer.spec if using buildozer. Gets installed via pip if missing. tested and working!

The following recipes have been updated:

  • cffi
  • cryptography
  • enum34
  • idna
  • ipaddress
  • openssl
  • pyasn1
  • pycparser
  • pyopenssl
  • twisted (added documentation about dependencies needed to use TLS)

The following recipes have been fixed:

  • cryptography
    • openssl includes were missing in CFLAGS
    • dependencies were changed, enum34 and ipaddress are optional, since only needed in python2 (untested in python3)

The following is missing:

  • Fix autodownload of newer NDK
  • Fix java source and target version when calling ant

How to test this PR

Following is defined in buildozer.spec:

android.api = 28
android.minapi = 21
android.sdk = 24
android.ndk = 17c

UPDATE changes in buildozer.spec since opening this PR

  • android.api changed from 27 to 28
  • android.minapi changed from 19 to 21
  • android.sdk changed from 23 to 24
  • android.ndk changed from 16b to 17c

You need to download NDK r17c manually, because the automatic download failes and define the NDK location in the spec file like so:

android.ndk_path = ~/.buildozer/android/android-ndk-r17c

UPDATE NDK download is fixed with kivy/buildozer#747

Modify ~/.buildozer/android/platform/android-sdk-23/tools/ant/build.xml and set java.source and java.target to 1.7 if necessary.

UPDATE Changing java.source and java.target in build.xml seems not necessary any more in SDK 24

Try to build your app. Good luck!

akshayaurora and others added 30 commits October 9, 2016 14:56
…ies. Add openssl includes to CFLAGS when compiling cryptography.
@AndreMiras
Copy link
Member

AndreMiras commented Oct 20, 2018 via email

@Petar-Luketina
Copy link

@AndreMiras , I appreciate you letting me know that, especially from a mobile phone! I downloaded buildozer master branch from the website using git clone but how do I switch to that version?

@AndreMiras
Copy link
Member

AndreMiras commented Oct 20, 2018

Yep not easy from the phone 😛

pip install --user --upgrade https://github.com/kivy/buildozer/archive/master.zip

@Petar-Luketina
Copy link

Yes, @AndreMiras , that worked! Thank you so much @rnixx , @inclement , and @AndreMiras !!!

@Blackth01
Copy link

@Blackth01 What device / android version are you encountering the error?

@rnixx on a Galayx J5 (SM-J500M) with android 6.0.1

@brvier
Copy link
Contributor

brvier commented Oct 24, 2018

Look like numpy doesnt run ...
ImportError: dlopen failed: cannot locate symbol "cpowf" referenced by "/data/data/.../files/app/lib/python2.7/site-packages/numpy/core/umath.so"...

@brvier
Copy link
Contributor

brvier commented Nov 6, 2018

This happen only on Samsung Galaxy J3 not on an Asus Zen Phone 3 Max

@rnixx rnixx changed the title WIP: Api level 27, Recipe Updates and Fixes WIP: Api level 28, NDK 17c - Recipe Updates and Fixes Nov 9, 2018
@rnixx
Copy link
Member Author

rnixx commented Nov 9, 2018

ftello64 error is gone on android < 7 since disabling large file support when building python2

@rnixx
Copy link
Member Author

rnixx commented Nov 9, 2018

@brvier can you tell me the android versions of this devices?

numpy build probably somewhere has a switch to use cpowf if available. i guess it works on recent versions of android and fails on older ones and needs to be patched away

@rnixx
Copy link
Member Author

rnixx commented Nov 9, 2018

@Blackth01 can you try again please with updated PR. disabling lfs seems to solve some problems

@Blackth01
Copy link

Blackth01 commented Nov 16, 2018

@Blackth01 can you try again please with updated PR. disabling lfs seems to solve some problems

@rnixx, I tried to build it with the updated PR and it worked pretty well, the app was installed and now runs without any error, I only had some problems with cryptography, 'cause it was not finding module enum or something like that, but adding enum in the requirements worked fine. Thank you very much!

@brvier
Copy link
Contributor

brvier commented Nov 16, 2018

@brvier can you tell me the android versions of this devices?

numpy build probably somewhere has a switch to use cpowf if available. i guess it works on recent versions of android and fails on older ones and needs to be patched away

Sorry, answer by email havent been added.

So still have problem with numpy and latest patch, only on android <= 7.0.
Original error was: dlopen failed: cannot locate symbol "ftello64" referenced by "/data/data/net.chronolife.chronomonitoring/files/app/lib/python2.7/site-packages/numpy/core/multiarray.so"...
Probably numpy need to have large file support disabled too ...

@rnixx
Copy link
Member Author

rnixx commented Nov 19, 2018

@brvier Actually the underlying problem of all the "cannot locate symbol" errors is that p4a does not (or did not - there's WIP about it) define the NDK API from min Android API level. It compiles against target Android API level, which causes missing functionality on older devices due to the wrong bionic lib.

Once the proper fix is merged into master, the whole problem should be gone, and the additional patches in this PR gets obsolete.

@ghost
Copy link

ghost commented Dec 9, 2018

Just to chime in, wouldn't it be good to somehow manage to keep large file support enabled (on supported API levels of course)? For dealing with large files and such

@rnixx
Copy link
Member Author

rnixx commented Dec 10, 2018

@Jonast see above,

Once the proper fix is merged into master, the whole problem should be gone, and the additional patches in this PR gets obsolete.

@bunmalik
Copy link

@AndreMiras @inclement @Blackth01 please I have a pending issue waiting for a reply. I need it fixed urgently! kivy/buildozer#772

@KeyWeeUsr
Copy link
Contributor

@AndreMiras @inclement @Blackth01 please I have a pending issue waiting for a reply. I need it fixed urgently! kivy/buildozer#772

Everyone here is doing stuff in their free time, you won't get any further with demanding anything. Quite opposite. If this patch works for you, you can clone p4a locally, apply it to the local clone and in .spec file set the path for p4a to your local clone.

@AndreMiras
Copy link
Member

@bunmalik I second what @KeyWeeUsr said. But it might be another way to speed things up. You can sponsor the project here https://opencollective.com/kivy or open a bug bounty directly for this issue. Sometime money can catalyse things... and sometimes not 😄
In any case also like @KeyWeeUsr said, you can clone that for locally and hook to it. Feel free to join the chat if you need assistance in doing so.

@rnixx
Copy link
Member Author

rnixx commented Feb 17, 2019

PR is obsolete.

@rnixx rnixx closed this Feb 17, 2019
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

Successfully merging this pull request may close these issues.

10 participants