After updating to 1.8.1 App crashes

Hi, i undated my cocos creator to 1.8.1 and i build my project, it completed and when i run the app it crashes on start. this migration is really frustrating: PLEASE HELP!..my log cat showed me this error:

/vendor/lib, /system/lib]]]: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:359)
at java.lang.System.loadLibrary(System.java:514)
at org.cocos2dx.lib.Cocos2dxActivity.a(Unknown Source)
at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Unknown Source)
at org.cocos2dx.javascript.AppActivity.onCreate(Unknown Source)
at android.app.Activity.performCreate(Activity.java:5122)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1081)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2277)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2365)
at android.app.ActivityThread.access$600(ActivityThread.java:156)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:153)
at android.app.ActivityThread.main(ActivityThread.java:5336)
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:833)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system

Can you try 1.8.2 or 1.9.0, please? http://cocos2d-x.org/download

ok im trying 1.9.0, will respond if it works or dont work

so i build, and generated the apk, when i run it crashes, when you go to the logcat on android studio i see this error, again PLEASE HELP:

cannot locate symbol “rand” referenced by “libcocos2djs.so”…
03-16 19:39:35.454 25662-25662/? E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.UnsatisfiedLinkError: Cannot load library: soinfo_relocate(linker.cpp:975): cannot locate symbol “rand” referenced by “libcocos2djs.so”…
at java.lang.Runtime.loadLibrary(Runtime.java:365)
at java.lang.System.loadLibrary(System.java:514)
at org.cocos2dx.lib.Cocos2dxActivity.onLoadNativeLibraries(Cocos2dxActivity.java:251)
at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:280)
at org.cocos2dx.javascript.AppActivity.onCreate(AppActivity.java:40)
at android.app.Activity.performCreate(Activity.java:5122)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1081)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2277)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2365)
at android.app.ActivityThread.access$600(ActivityThread.java:156)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:153)
at android.app.ActivityThread.main(ActivityThread.java:5336)
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:833)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)

Rand. There are many threads about this I think on these forums.

still no luck, its frustrating trying to get this to work, is reverting back to cocos creator 1.6.1 a bad thing? because my application worked perfectly before the update

PLEASE HELPPP, this is so frustrating, error after error

C:/Users/Freshprince/Desktop/Coco2dxProject/test/build/jsb-default/frameworks/cocos2d-x/cocos/…/external/sources/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.cpp:53:1: fatal error: opening dependency file C:/Users/Freshprince/Desktop/Coco2dxProject/test/build/jsb-default/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/release/obj/local/armeabi/objs/cis//external/sources/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.o.d: No such file or directory
}
^
compilation terminated.
make: *** [C:/Users/Freshprince/Desktop/Coco2dxProject/test/build/jsb-default/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/release/obj/local/armeabi/objs/cis/
/external/sources/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.o] Error 1
make: *** Waiting for unfinished jobs…
:WhatYuhKnow:externalNativeBuildRelease FAILED
:WhatYuhKnow:externalNativeBuildRelease (Thread[Daemon worker Thread 4,5,main]) completed. Took 19.696 secs.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:WhatYuhKnow:externalNativeBuildRelease’.

Build command failed.
Error while executing process C:\Users\Freshprince\Desktop\adt-bundle-windows-x86_64-20140321\sdk\ndk-bundle\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\Freshprince\Desktop\Coco2dxProject\test\build\jsb-default\frameworks\runtime-src\proj.android-studio\app\jni\Android.mk NDK_APPLICATION_MK=C:\Users\Freshprince\Desktop\Coco2dxProject\test\build\jsb-default\frameworks\runtime-src\proj.android-studio\app\jni\Application.mk APP_ABI=armeabi NDK_ALL_ABIS=armeabi NDK_DEBUG=0 APP_PLATFORM=android-14 NDK_OUT=C:/Users/Freshprince/Desktop/Coco2dxProject/test/build/jsb-default/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/release/obj NDK_LIBS_OUT=C:\Users\Freshprince\Desktop\Coco2dxProject\test\build\jsb-default\frameworks\runtime-src\proj.android-studio\app\build\intermediates\ndkBuild\release\lib NDK_TOOLCHAIN_VERSION=4.9 APP_PLATFORM=android-27 NDK_MODULE_PATH=C:\Users\Freshprince\Desktop\Coco2dxProject\test\build\jsb-default\frameworks\cocos2d-x;C:\Users\Freshprince\Desktop\Coco2dxProject\test\build\jsb-default\frameworks\cocos2d-x\cocos;C:\Users\Freshprince\Desktop\Coco2dxProject\whatyuhknow190\build\jsb-default\frameworks\cocos2d-x\external -j4 NDK_DEBUG=0 C:/Users/Freshprince/Desktop/Coco2dxProject/test/build/jsb-default/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/release/obj/local/armeabi/libcocos2djs.so}
C:/Users/Freshprince/Desktop/adt-bundle-windows-x86_64-20140321/sdk/ndk-bundle/build//…/build/core/setup-app.mk:81: Android NDK: Application targets deprecated ABI(s): armeabi
C:/Users/Freshprince/Desktop/adt-bundle-windows-x86_64-20140321/sdk/ndk-bundle/build//…/build/core/setup-app.mk:82: Android NDK: Support for these ABIs will be removed in a future NDK release.
[armeabi] Compile++ arm : cocos2djs_shared <= AppDelegate.cpp
[armeabi] Compile++ arm : cocos2djs_shared <= jsb_module_register.cpp
[armeabi] Compile++ arm : cis <= b2ChainAndPolygonContact.cpp
C:/Users/Freshprince/Desktop/Coco2dxProject/test/build/jsb-default/frameworks/cocos2d-x/cocos/…/external/sources/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.cpp:53:1: fatal error: opening dependency file C:/Users/Freshprince/Desktop/Coco2dxProject/test/build/jsb-default/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/release/obj/local/armeabi/objs/cis//external/sources/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.o.d: No such file or directory
}
^
compilation terminated.
make: *** [C:/Users/Freshprince/Desktop/Coco2dxProject/test/build/jsb-default/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/release/obj/local/armeabi/objs/cis/
/external/sources/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.o] Error 1
make: *** Waiting for unfinished jobs…

Let me ask our engineering team to look at this thread.

1 Like

Hi @freshprince,

I had the same problem and disabling some unused physic modules solved the problem:

Of course if your project uses physics it won’t solve your problem.

Best regards,
Zsolt

2 Likes

i reverted back to 1.6.1 and my project works perfectly again, i thought updating wouldnot have been so much trouble but it started to frustrate me, thanks for the solution though, this will help many others with this problem hopefully

You’re welcome! Of course it’s just a workaround, the dev team has to fix this issue, but fortunately I can relese the next update of my game.

1 Like

It is a bug about Android Studio that not support path which is longer than 256 characters. Place your project just in C:/Coco2dxProject will solve this problem. We have added some warning in 1.10 to avoid frustration

2 Likes