I’m trying to run app on my nexus 5
in adb logcat noticed errors like (in few places):
10-30 21:36:58.042 11191 11191 W System.err: dlopen failed: library "/home/joshua/Development/Android/android-ndk-r8b/platforms/android-9/arch-arm/usr/lib/libc.so" not found
There might be something wrong with Android template.
In my fork, I got merge conflict when I merged 2.7.0 as I updated template by myself, so I just selected mine. As a result I didn’t see error like that.
It shouldn’t be the template – that includes the Lime binary, and other additional binaries used by the project (HXCPP standard or extension binaries) but we don’t include libc on any builds, this should be on the system
I have a Nexus 7 running Android Marshmallow. Previously I was targeting SDK 17 with Java 6, which was fine. Our publisher required an upgrade to sdk 23. So I targeted SDK 23 with Java 7 (the output heavily suggested I upgrade the compiler)
After fixing a few build errors I was able to push to my device, but it crashes on startup with the following error:
FATAL EXCEPTION: main
11-05 13:28:18.915 3097 3097 E AndroidRuntime: Process: com.armorgames.sodadungeon, PID: 3097
11-05 13:28:18.915 3097 3097 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: library “/home/joshua/Development/Android/android-ndk-r8b/platforms/android-9/arch-arm/usr/lib/libc.so” not found
An update: I am able to build to SDK 22 just fine. I’m thinking that maybe a change in the permissions system for SDK 23 is to blame, but I can’t really say for sure at this point.
I may have found some clues as to why SDK 23 breaks things:
This release updates the behavior of the dynamic linker. The dynamic linker now understands the difference between a library’s soname and its path ( public bug 6670), and search by soname is now implemented. Apps which previously worked that have bad DT_NEEDED entries (usually absolute paths on the build machine’s file system) may fail when loaded.
The dlopen(3) RTLD_LOCAL flag is now correctly implemented. Note that RTLD_LOCAL is the default, so calls to dlopen(3) that didn’t explicitly use RTLD_LOCAL will be affected (unless your app explicitly used RTLD_GLOBAL). With RTLD_LOCAL, symbols will not be made available to libraries loaded by later calls to dlopen(3) (as opposed to being referenced by DT_NEEDED entries).
On previous versions of Android, if your app requested the system to load a shared library with text relocations, the system displayed a warning but still allowed the library to be loaded. Beginning in this release, the system rejects this library if your app’s target SDK version is 23 or higher. To help you detect if a library failed to load, your app should log the dlopen(3) failure, and include the problem description text that the dlerror(3) call returns. To learn more about handling text relocations, see this guide.
Of these clues, the “no text relocations” seems the most likely. I remember seeing warnings about text relocations before? Though odd that it fails on libc – that’s really outside of our control.
Okay, I think I finally solved the issue I was having…
Through process of elimination, I figured out that ganalytics was the culprit. Turns out it just needed to be recompiled (makes sense), though using lime rebuild ganalytics android like it said to do in its readme didn’t do the trick – I had to haxelib run hxcpp Build.xml -Dandroid -DHXCPP_ARMV7 instead.
I also updated JDK to the latest (8u92) and everything built fine (including release signing). The builds are also much faster! Used to take 2.5-3 mins to build/deploy changes to my phone, and now it only takes 45 seconds!! (The total build time JDK reports right before deploying went from 1.5-2 mins, down to just 15 seconds!)
Maybe it’s time to update the Android setup instructions to finally stop using 6u45 and instead switch to the latest as one other user has also reported that JDK 8 works fine for building/signing.
Hello… I have an android apk running fine compiled with the following version:
openfl: 4.4.0
Lime: 3.4.1
hxcpp: 3.4.43
However when the client tried the apk on a Hawei mate9 it throwns an error DEtected problems with app native libraries. libApplicationMain.so Invalid DT_NEEDED entry d:\androidSDK\android-ndk-r8b …
I tried the following:
openfl setup android, and set the directory to d:\androidSDK\android-ndk-r13b
openfl clear android
openfl test android
(nothing changes, still compiles using d:\androidSDK\android-ndk-r8b)
Manually edit Users\myUser.lime\config.xml and set the ndk directory to d:\androidSDK\android-ndk-r13b
Same result… still compiles using d:\androidSDK\android-ndk-r8b
then I tried,
haxelib update
it downloads and installs
openfl: 4.9.1
Lime: 4.0.1
hxcpp: 3.4.64
openfl clear android
openfl test android
(compiles using d:\androidSDK\android-ndk-r8b) and application stops working.
If someone can give me a clue on how to proceed I would really appreciate. I come from flash world, so all this version and compiler options are a complete mess for me.
We have seen issues using newer Android devices, with the older Android NDK. In order for it to work properly, all binaries (Lime, HXCPP and your application) must be compiled with a newer NDK.
Perhaps this version of Lime is older than when we updated our toolchain to use a newer NDK for the official builds?
do you recomend to make a clean install of everything from scratch?
How can I create all binaries using new ndk?
as I said:
I tried the following:
openfl setup android, and set the directory to d:\androidSDK\android-ndk-r13b
openfl clear android
openfl test android
(nothing changes, still compiles using d:\androidSDK\android-ndk-r8b)
Manually edit Users\myUser.lime\config.xml and set the ndk directory to d:\androidSDK\android-ndk-r13b
Same result… still compiles using d:\androidSDK\android-ndk-r8b
Lime configures settings in “C:\Users<your user name>.lime\config.xml”, but it’s possible that HXCPP has a setting that is overriding your choice in Android NDK.
Check “C:\Users<your user name.hxcpp-config.xml” as well. You may be able to delete or update the Android NDK path set there
That might be enough, but if it is not, you will need to either update, or clone Lime from the source (at your same version) and rebuild it yourself.