Android NDK UnsatisfiedLinkError - a surprising reason -


update 8/7/2013: problem solved now, reason error quite unexpected, usual suspects such errors eliminated on start, , have learned new. see answer below.


i'm pretty desperate here. have android app native library, call method. no problem on systems tested, , program out in google play without trouble reports, used thousands of users. now, apparently new rom - android version 4.2.2 - htc 1 phone out. users claim it's official build, upgraded form official channel. when try start app, crashes, , stack trace says:

java.lang.unsatisfiedlinkerror: native method not found...

and method name of know there , worked fine moment ago on same device when had android 4.1 installed. test under android 4.2.2 in emulators (don't have particular device) , there no problem. also, users tried uninstalling , reinstalling app same result. sending them private build, without proguard/dexguard protections not help.

what else can cause java.lang.unsatisfiedlinkerror on android? or should assume htc rom buggy??? did else have similar problems on htc 1 android 4.2.2?

edit 7/24/2013

in comments below developer suggests system have troubles finding native library. experimented on genymotion 4.2.2 emulator removing native library file setup completely. error message different in situation, got:

w/system.err: caused by: java.lang.unsatisfiedlinkerror: couldn't load cld loader dalvik.system.pathclassloader[dexpath=/data/app/com.hyperionics.avar-2.apk,libra‌​rypath=/data/app-lib/com.hyperionics.avar-2]: findlibrary returned null

while in stack trace messages got htc 1 users android 4.2.2 see error message:

caused by: java.lang.unsatisfiedlinkerror: native method not found: com.hyperionics.avar.cldwrapper.detectlangnative:(ljava/lang/string;)[ljava/lang‌​/string;

to me appears system finds libcld.so file needed, not find method needs there. why??? know method there, exported needed, , every other device , system, these running android 4.2.2, finds it. htc 1 4.2.2 fails there...

update 7/25/2013

started bounty 50 rep. points, don't have htc 1 , stuck. accept answer either points way solving problem - , answering person test code mod. show works - or proves bug in recent android 4.2.2 rom htc one. app in question https://play.google.com/store/apps/details?id=com.hyperionics.avar

update 7/31/2013

the last day of bounty , still no answers, no suggestions... far, such error reports come europe, reported brand "htc_europe" or "vodafone_fr". maybe error localized europe (france + germany) only... if there out there htc 1 , android updated 4.2.2, interested if error happens in other countries or other providers.

greg

there no satisfactory answer during bounty period. ordered device , have debug system bug in device rom android 4.2.2 update...

update 6/20/2014 reason occasional unsatisfiedlinkerror

it turns out sometimes, when updating app google play, native libraries not installed correctly. maybe installer runs out of space, or other strange system bug kicks in. please see this question , answers.

update 8/6/2013 - mystery solved!

my htc 1 ordered google play arrived, and... mystery solved! same crash happened on original android 4.2.2 google play. problem library name: cld, produces shared library named libcld.so. apparently system has shared library same name, methods expect not present, of course... "plugin" loaded other libcld.so process memory, , own library skipped. renamed native library , program started working @ once.

i not aware of possibility of such name clashes on different builds of android... did reading see warning somewhere in ndk docs it? guess i'll prefix on native libraries create company name or something.


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -