运行 java cocosdx Couldn't load cocos2dx: findLibrary returned null

08-31 18:02:22.339: E/AndroidRuntime(1338): FATAL EXCEPTION: main
08-31 18:02:22.339: E/AndroidRuntime(1338): java.lang.ExceptionInInitializerError
08-31 18:02:22.339: E/AndroidRuntime(1338): 	at java.lang.Class.newInstanceImpl(Native Method)
08-31 18:02:22.339: E/AndroidRuntime(1338): 	at java.lang.Class.newInstance(Class.java:1409)
08-31 18:02:22.339: E/AndroidRuntime(1338): 	at android.app.Instrumentation.newActivity(Instrumentation.java:1020)
08-31 18:02:22.339: E/AndroidRuntime(1338): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1600)
08-31 18:02:22.339: E/AndroidRuntime(1338): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1702)
08-31 18:02:22.339: E/AndroidRuntime(1338): 	at android.app.ActivityThread.access$1600(ActivityThread.java:118)
08-31 18:02:22.339: E/AndroidRuntime(1338): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:952)
08-31 18:02:22.339: E/AndroidRuntime(1338): 	at android.os.Handler.dispatchMessage(Handler.java:99)
08-31 18:02:22.339: E/AndroidRuntime(1338): 	at android.os.Looper.loop(Looper.java:130)
08-31 18:02:22.339: E/AndroidRuntime(1338): 	at android.app.ActivityThread.main(ActivityThread.java:3768)
08-31 18:02:22.339: E/AndroidRuntime(1338): 	at java.lang.reflect.Method.invokeNative(Native Method)
08-31 18:02:22.339: E/AndroidRuntime(1338): 	at java.lang.reflect.Method.invoke(Method.java:507)
08-31 18:02:22.339: E/AndroidRuntime(1338): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
08-31 18:02:22.339: E/AndroidRuntime(1338): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
08-31 18:02:22.339: E/AndroidRuntime(1338): 	at dalvik.system.NativeStart.main(Native Method)
08-31 18:02:22.339: E/AndroidRuntime(1338): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load cocos2dx: findLibrary returned null
08-31 18:02:22.339: E/AndroidRuntime(1338): 	at java.lang.Runtime.loadLibrary(Runtime.java:429)
08-31 18:02:22.339: E/AndroidRuntime(1338): 	at java.lang.System.loadLibrary(System.java:554)
08-31 18:02:22.339: E/AndroidRuntime(1338): 	at com.hand.CPlusEvem.<clinit>(CPlusEvem.java:108)
08-31 18:02:22.339: E/AndroidRuntime(1338): 	... 15 more


it seems that it can not load the library.

The error message would print which library(xxs.so) is missed.

 You should check the library in .apk.

library 配置问题

新版本的cocos2d-x将会在你的java工程下的 public class CPlusEvem extends Cocos2dxActivity下的

     static {
         System.loadLibrary("game");
         System.loadLibrary("cocos2dx");
     }


改为

     static {
         System.loadLibrary("game");
      }


 


 

你可能感兴趣的:(java,exception,null,Class,library)