未找到Android UnsatisfiedLinkError本机方法

时间:2014-01-21 13:08:55

标签: android android-ndk

我正在构建原生应用。当我想开始这个应用程序logcat说

FATAL EXCEPTION: SDLThread
Process: org.libsdl.app, PID: 1560
 java.lang.UnsatisfiedLinkError: Native method not found: org.libsdl.app.SDLActivity.nativeInit:()V
at org.libsdl.app.SDLActivity.nativeInit(Native Method)
at org.libsdl.app.SDLMain.run(SDLActivity.java:421)
at java.lang.Thread.run(Thread.java:841)

正确加载库。

Trying to load lib /data/app-lib/org.libsdl.app-1/libSDL2.so 0xb1ddc818
Added shared lib /data/app-lib/org.libsdl.app-1/libSDL2.so 0xb1ddc818
Trying to load lib /data/app-lib/org.libsdl.app-1/libmain.so 0xb1ddc818
Added shared lib /data/app-lib/org.libsdl.app-1/libmain.so 0xb1ddc818
No JNI_OnLoad found in /data/app-lib/org.libsdl.app-1/libmain.so 0xb1ddc818, skipping init

在main中,我可以看到

T Java_org_libsdl_app_SDLActivity_nativeInit

1 个答案:

答案 0 :(得分:0)

如果使用SDL_Main作为入口点需要调用

void SDL_SetMainReady(void)
SDL_Init()之前的

详情请见:http://wiki.libsdl.org/SDL_SetMainReady