Issue
I am trying to build my first Hello World Cocos2D project. I am using NDK r10e and already imported the library.
First got this error while trying to build with Android 22, then switched to Android 19 as advised in previous questions, but it didn't solve. I get the following logcat:
07-13 16:04:30.416: E/AndroidRuntime(26892): FATAL EXCEPTION: main
07-13 16:04:30.416: E/AndroidRuntime(26892): Process: com.danielemolinari.HelloWorld, PID: 26892
07-13 16:04:30.416: E/AndroidRuntime(26892): java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "srand" referenced by "libcocos2dcpp.so"...
07-13 16:04:30.416: E/AndroidRuntime(26892): at java.lang.Runtime.loadLibrary(Runtime.java:365)
07-13 16:04:30.416: E/AndroidRuntime(26892): at java.lang.System.loadLibrary(System.java:526)
07-13 16:04:30.416: E/AndroidRuntime(26892): at org.cocos2dx.lib.Cocos2dxActivity.onLoadNativeLibraries(Cocos2dxActivity.java:207)
07-13 16:04:30.416: E/AndroidRuntime(26892): at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:222)
07-13 16:04:30.416: E/AndroidRuntime(26892): at android.app.Activity.performCreate(Activity.java:5451)
07-13 16:04:30.416: E/AndroidRuntime(26892): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
07-13 16:04:30.416: E/AndroidRuntime(26892): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2377)
07-13 16:04:30.416: E/AndroidRuntime(26892): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2471)
07-13 16:04:30.416: E/AndroidRuntime(26892): at android.app.ActivityThread.access$900(ActivityThread.java:175)
07-13 16:04:30.416: E/AndroidRuntime(26892): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
07-13 16:04:30.416: E/AndroidRuntime(26892): at android.os.Handler.dispatchMessage(Handler.java:102)
07-13 16:04:30.416: E/AndroidRuntime(26892): at android.os.Looper.loop(Looper.java:146)
07-13 16:04:30.416: E/AndroidRuntime(26892): at android.app.ActivityThread.main(ActivityThread.java:5602)
07-13 16:04:30.416: E/AndroidRuntime(26892): at java.lang.reflect.Method.invokeNative(Native Method)
07-13 16:04:30.416: E/AndroidRuntime(26892): at java.lang.reflect.Method.invoke(Method.java:515)
07-13 16:04:30.416: E/AndroidRuntime(26892): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
07-13 16:04:30.416: E/AndroidRuntime(26892): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
07-13 16:04:30.416: E/AndroidRuntime(26892): at dalvik.system.NativeStart.main(Native Method)
Any advice?
Solution
EDIT: SOLVED To solve the error:
- Install Android 19 Platform in Android SDK
- Delete project
- Create a new project
- Compile with Android 19
It will work on any Android device, even on Lollipop.
Answered By - Daniele Molinari
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.