rhomobile / rhodes

The Rhodes framework is a platform for building locally executing, device-optimized mobile applications for all major smartphone devices.
http://tau-platform.com/
MIT License
1.05k stars 237 forks source link

NDK 20 breaks Android 5.x.x #1006

Closed leonardofalk closed 5 years ago

leonardofalk commented 5 years ago

I'm using rhodes master branch (commit 1225a60826c0768129802606ae370d1b324c1ae5), testing x64 support, apparently the new NDK defaults hash-style config to somewhat incompatible with Android 5.

More info: https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#gnu-hashes-availible-in-api-level-23

Adding flag -Wl,--hash-style=both to android.rake makes it work again, but then another error happens:

UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__register_atfork" referenced by "librhodes.so"

More info: https://github.com/android-ndk/ndk/issues/964

This happens because we're targeting Android SDK Level 26 (minSDK is marked as 21), which is a Google Play requirement since November 1, 2018. If I change targetSdkVer to API to 21 it works again, but I can't upload it to Google Play.

akaquazzar commented 5 years ago

Try this commit 7cd94498505c0d8fd5fc918002f72c362c4940ed. Add to your config option (in android section) minSDK: 21, If you do not specify it, there will be an attempt to search for level 19, if it is not found, the latest version will be selected.

leonardofalk commented 5 years ago

@akaquazzar Thanks, I'll test as soon as I can, but doesn't it also needs an extra flag for task build:android:librhodes ?

Locally I've added this flag to this line

  args << '-Wl,--hash-style=both'

This solved the original problem, before SDK target error.

akaquazzar commented 5 years ago

Yes, I add this to the linker.