0
0

Hi

I have the following Exception on Samsung GT-S5369, GT-S5363, GT-S5830T and GT-S5830i on android 2.3.3 and above using the current version of FMOD.

[code:e1avohui]java.lang.ExceptionInInitializerError
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1409)
at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1565)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3687)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.UnsatisfiedLinkError: Couldn’t load fmodex: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:429)
at java.lang.System.loadLibrary(System.java:554)
at com.blabla.fs2012.Fs2012Activity.<clinit>(Fs2012Activity.java:22)
[/code:e1avohui]

Does anyone have any idea what could be the cause?

  • You must to post comments
0
0

Is it possible that the APK on certain devices isn’t deploying the ARMv6 version of your game properly? I do not have those devices here to test with, but the error seems to indicate the FMOD library for that architecture is missing so I can only speculate.

  • You must to post comments
0
0

This error doesn’t occur on the ARMv6 phones we have here for testing (Samsung GT-S5360 and GT-S5380). So the issue is not necessarily related to ARMv6.
Maybe one or more of the system’s shared libraries FMOD depends on are "incompatible" on certain devices. Which NDK version do you use to compile your SO libraries?

We could include the following libraries in our APK:

libc.so
libstdc++.so
libm.so
libdl.so
liblog.so

What do you think?

  • You must to post comments
0
0

Hmm, it would be good if we could get the output from the dynamic linker to find out exactly what it’s complaining about unfortunately I cannot see a way to do this on Android.

Currently we compile against r5b NDK for FMOD releases, our linker line has the following regarding libs used:
-lc -lstdc++ -lgcc -lm -ldl -llog ${SYSROOT}/usr/lib/crtbegin_so.o

  • You must to post comments
0
0

Here is another call stack from a crash report. Maybe this error ("missing essential tables") gives you a hint. We only got this error in 1 out of 14 reports.

java.lang.ExceptionInInitializerError
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1409)
at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1565)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3687)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1934]: 121 missing essential tables
at java.lang.Runtime.loadLibrary(Runtime.java:434)
at java.lang.System.loadLibrary(System.java:554)
at com.giantssoftware.fs2012.Fs2012Activity.<clinit>(Fs2012Activity.java:23)

  • You must to post comments
0
0

Thanks for the additional information, but I can’t seem to determine what would cause this problem. You can see the Android dynamic linker source here:
https://github.com/android/platform_bio … r/linker.c

The error "missing essential tables" comes from loading a library that is missing either DT_STRTAB or DT_SYMTAB representing the string table or symbol table respectively. You can use the following to verify the sections are present in the FMOD libraries:
[code:2rrf5jm4]arm-linux-androideabi-readelf -d libfmodex.so[/code:2rrf5jm4]

I cannot tell if the link error is talking about FMOD or another dependency, the error text has "link_image", the function where the error occurred, "[1934]", the code line number (which matches the gingerbread source), "121", the process ID, "missing essential tables" the error message. Nothing specific to the lib that it is talking about.

  • You must to post comments
0
0

Thanks for hints, I checked and the FMOD library we use has both, DT_STRTAB and DT_SYMTAB listed in arm-linux-androideabi-readelf output.

I just noticed that we have two linker warnings related to FMOD library:

ld.exe: warning: hidden symbol ‘__aeabi_atexit’ in <…>/obj/local/armeabi/libgnustl_static.a(atexit_arm.o) is referenced by DSO
ld.exe: warning: hidden symbol ‘__dso_handle’ in <…>/android-ndk-r8c/platforms/android-9/arch-arm/usr/lib/crtbegin_so.o is referenced by DSO

Maybe this causes problems on certain devices and the dynamic linker refuses to load FMOD lib because of those hidden symbols.

  • You must to post comments
0
0

It’s looking like some kind of binary compatibility issue, I’ll get FMOD compiling against r8d for our next release and we can see if that clears this up.

  • You must to post comments
0
0

That might well be the case, we’re currently using NDK r8c for compiling which doesn’t export the mentioned handles anymore. Excerpt from changelog NDK r8c:

===
– Fixed libc.so to not export atexit() and __do_handler. These symbols are exported
on ARM by the system version of the C library to support legacy native libraries.
NDK-generated should never reference them directly. Instead, each shared library or
executable should embed its own version of these symbols, provided by crtbegin_*.o

If your project is linked with "-nostdlib -Wl,–no-undefined", you need to provide
your own __dso_handle because crtbegin_so.o isn’t linked. The content of __dso_handle
doesn’t matter. eg.

extern &quot;C&quot; {
  extern void *__dso_handle __attribute__((__visibility__ (&quot;hidden&quot;)));
  void *__dso_handle;

}

We will also update to NDK r8d if you do not encounter any problems.

  • You must to post comments
0
0

Hi Mathew,

The exception occurs only on a small percentage of Samsung GT-S5369, GT-S5363, GT-S5830T and GT-S5830i phones (about 5%).
We tested with GT-S5363 and GT-S5830T phones here locally and it worked perfect.

Link to our app: [url:3hr0k4af]https://play.google.com/store/apps/details?id=com.giantssoftware.fs2012[/url:3hr0k4af]

Best,
Thomas

  • You must to post comments
0
0

A quick check of the first phone listed reveals it’s an ARM 6 phone. The error you are getting is the runtime cannot find the FMOD lib, so it sounds like a configuration issue with your APK.

Make sure your Android.mk is set up to properly locate the FMOD lib for the target ABI and the Application.mk it set up to support armeabi, check the FMOD examples for reference.

  • You must to post comments
Showing 10 results
Your Answer

Please first to submit.