| Summary: | Android rare bug : FindLibrary return null | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Sylvain <sylvain.becker> |
| Component: | *don't know* | Assignee: | Gabriel Jacobo <gabomdq> |
| Status: | RESOLVED WONTFIX | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | ARM | ||
| OS: | Android (All) | ||
| Attachments: | new findlibrary with extraction of .so from .apk | ||
|
Description
Sylvain
2013-08-01 02:31:59 UTC
Maybe corrupt or incomplete installation? I've seen this happen when the runtime dependencies of the SDL2.so are not met, which probably means the Android version the user has is below the minimum (which may happen if they side load the app for example, or you have the wrong setting in AndroidManifest.xml). Hard to say for sure without more information. Here's the little changes I did : I modified the "AndroidManifest.xml" with the following : <!-- Android 2.3.3 at Least, but tested and targeted on API-17 --> <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="17" /> I modified "project.properties" target=android-17 I've just noticed that "default.properties" contains : target=android-7 If it was a dependency missing I would expect the name of a function or a library. Well I don't know.. Do you have additional info to help track this down? To be optimistic, I would say it seem to appear less often. But still maybe 1 per 20000 install. Sometimes the exception appears with a *weird* path see the suffix "-2" : ----------------------------------------------------------------------- Caused by: java.lang.UnsatisfiedLinkError: Couldn't load SDL2 from loader dalvik.system.PathClassLoader[dexPath=/data/app/net.myapp.mygame-2.apk,libraryPath=/data/data/net.myapp.mygame/lib]: findLibrary returned null Once I also got this one : ------------------------- Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: get_lib_extents[760]: 73 - /mnt/asec/net.myapp.mygame-1/lib/libSDL2_mixer.so is not a valid ELF object at java.lang.Runtime.loadLibrary(Runtime.java:434) at java.lang.System.loadLibrary(System.java:554) at org.libsdl.app.SDLActivity.<clinit>(SDLActivity.java:57) (Notice that libSD2_mixer is loaded after libSDL2! so why this occured only for mixer and not for SDL2 ??) Also, I got (recently : 1 sept. 2013) : ------------------------------------- java.lang.UnsatisfiedLinkError: Native method not found: org.libsdl.app.SDLActivity.onNativeSurfaceChanged:()V at org.libsdl.app.SDLActivity.onNativeSurfaceChanged(Native Method) at org.libsdl.app.SDLSurface.surfaceChanged(SDLActivity.java:518) at android.view.SurfaceView.updateWindow(SurfaceView.java:591) at android.view.SurfaceView.access$000(SurfaceView.java:83) at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:177) at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:726) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2086) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1127) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4650) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:747) at android.view.Choreographer.doCallbacks(Choreographer.java:567) at android.view.Choreographer.doFrame(Choreographer.java:536) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:733) at android.os.Handler.handleCallback(Handler.java:615) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:153) at android.app.ActivityThread.main(ActivityThread.java:4987) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:821) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584) at dalvik.system.NativeStart.main(Native Method) (and also today only : java.lang.UnsatisfiedLinkError: onNativeSurfaceChanged) Notice that it always only appears maybe 1 per 20.000 install ! With severals apps. All my apps have no obvious bug :). Valgrind cleaned (on linux, I did not tried on device). It compiles with no warning, with many compilers (gcc,clang, and winrt/windows8). I dont use opengl directly, but only the sdl renderer. I think I have the option -fno-rtti and I dont use the dynamic cast. I used to compile with ndk-9, but will switch to ndk-9b. I plan to release a new game in a couple of days. Tell me if you need more information. The onNativeSurfaceChanged error could happen if you mismatched the SDLActivity.java file with the wrong libSDL2.so file. It ought to be consistent though (several reports from everyone that tries your app). As it is, I'm inclined to mark this as "won't fix", there's stuff involved in this that we can't do anything about (funky Android distros, low memory/disk space situations?) even if we can figure out what the actual problem is. No problem to mark this as "won't fix", I totally understand the lack of information and reproduction steps. Marking as WONTFIX for reasons stated above. Thanks for the feedback ! I Just add more information about this issue ... - Problem still happening with a new application. so using the latest version of SDL. - For this release, I build all the different abi (arm,arm-v7a,x86,mips) in different .apk and it is still happening. - I made only 1 version of the application. So the problem is not while "upgrading" the application. - phones are : hwy210-0151 Galaxy Ace (GT-S5830) yecon75_tb_ics hexing77_ics2 Wildfire S (marvel) hwy210-0151 ZTE V793 (P175A60) Created attachment 1482 [details]
new findlibrary with extraction of .so from .apk
Hello, here a few links of people having the same problem. https://code.google.com/p/android/issues/detail?id=59420 http://stackoverflow.com/questions/16450035/how-can-i-make-android-delete-old-native-libraries/16683835#16683835 https://code.google.com/p/android/issues/detail?id=35962 And for information, here is also a patch where I try to extract the libs from the .apk (if the usual *load library* path fails). It seems to work as I stop getting those "UnsatisfiedLinkError" since I use it ! Thanks, Sylvain |