我正在尝试运行我的应用程序,但每当调用本机函数时,程序崩溃,我得到以下LogCat …
08-01 09:15:57.448: E/AndroIDRuntime(16966): FATAL EXCEPTION: main08-01 09:15:57.448: E/AndroIDRuntime(16966): java.lang.ExceptionInInitializerError08-01 09:15:57.448: E/AndroIDRuntime(16966): at my.eti.commander.MainMenu.initMain(MainMenu.java:241)08-01 09:15:57.448: E/AndroIDRuntime(16966): at my.eti.commander.MainMenu.onCreate(MainMenu.java:81)08-01 09:15:57.448: E/AndroIDRuntime(16966): at androID.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)08-01 09:15:57.448: E/AndroIDRuntime(16966): at androID.app.ActivityThread.performlaunchActivity(ActivityThread.java:1611)08-01 09:15:57.448: E/AndroIDRuntime(16966): at androID.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)08-01 09:15:57.448: E/AndroIDRuntime(16966): at androID.app.ActivityThread.access00(ActivityThread.java:117)08-01 09:15:57.448: E/AndroIDRuntime(16966): at androID.app.ActivityThread$H.handleMessage(ActivityThread.java:931)08-01 09:15:57.448: E/AndroIDRuntime(16966): at androID.os.Handler.dispatchMessage(Handler.java:99)08-01 09:15:57.448: E/AndroIDRuntime(16966): at androID.os.Looper.loop(Looper.java:130)08-01 09:15:57.448: E/AndroIDRuntime(16966): at androID.app.ActivityThread.main(ActivityThread.java:3683)08-01 09:15:57.448: E/AndroIDRuntime(16966): at java.lang.reflect.Method.invokeNative(Native Method)08-01 09:15:57.448: E/AndroIDRuntime(16966): at java.lang.reflect.Method.invoke(Method.java:507)08-01 09:15:57.448: E/AndroIDRuntime(16966): at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)08-01 09:15:57.448: E/AndroIDRuntime(16966): at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:597)08-01 09:15:57.448: E/AndroIDRuntime(16966): at dalvik.system.NativeStart.main(Native Method)08-01 09:15:57.448: E/AndroIDRuntime(16966): Caused by: java.lang.UnsatisfIEdlinkError: Couldn't load RelayAPI: findlibrary returned null08-01 09:15:57.448: E/AndroIDRuntime(16966): at java.lang.Runtime.loadlibrary(Runtime.java:429)08-01 09:15:57.448: E/AndroIDRuntime(16966): at java.lang.System.loadlibrary(System.java:554)08-01 09:15:57.448: E/AndroIDRuntime(16966): at my.eti.commander.RelayAPIModel$NativeCalls.<clinit>(RelayAPIModel.java:432)08-01 09:15:57.448: E/AndroIDRuntime(16966): ... 15 more
这是我的AndroID.mk文件:
LOCAL_PATH := $(call my-dir)include $(CLEAR_VARS)EXTRA_CFLAGS := -DANDROIDLOCAL_MODulE := RelayAPILOCAL_SRC_fileS := RelayAPI.cinclude $(BUILD_EXECUtable)
这是我的jni文件夹的图片…将只使用RelayAPI,stringstuff是一个未使用的额外文件.
我将所有本机函数存储在一个单独的类中,以便可以静态调用它们.这不是问题,因为我已经将它们移动了很多但我只是认为这将是我完成它的最佳方式.
public static class NativeCalls { static { System.loadlibrary( "RelayAPI"); } public native static byte InitRelayJava(); public native static voID FreeRelayJava();}解决方法 不应该包含$(BUILD_SHARED_liBRARY)而不是include $(BUILD_EXECUtable)? 总结
以上是内存溢出为你收集整理的Android – ‘无法加载Foo:findLibrary返回null’全部内容,希望文章能够帮你解决Android – ‘无法加载Foo:findLibrary返回null’所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)