Sonar Cocos Helper cause crash on Android

  • Mantas
    Likes 0

    Problem Description

    Hello, I am trying to integrate Twitter into my app. But when I run my app it straight off crashes. Here is a log from Eclipse :

    06-01 05:21:09.185: I/art(1058): Not late-enabling -Xcheck:jni (already on)
    06-01 05:21:12.555: D/JniHelper(1058): JniHelper::setJavaVM(0xb4896200), pthread_self() = -1225090068
    06-01 05:21:12.632: D/main(1058): cocos_android_app_init
    06-01 05:21:12.716: D/Cocos2dxActivity(1058): model=sdk_phone_armv7
    06-01 05:21:12.720: D/Cocos2dxActivity(1058): product=sdk_phone_armv7
    06-01 05:21:12.721: D/Cocos2dxActivity(1058): isEmulator=true
    06-01 05:21:12.774: V/TESTTESTTEST(1058): FINISHED1
    06-01 05:21:12.774: V/TESTTESTTEST(1058): FINISHED2
    06-01 05:21:12.782: W/System.err(1058): java.lang.ClassNotFoundException: sonar.systems.frameworks.Facebook.Facebook
    06-01 05:21:12.785: W/System.err(1058): 	at java.lang.Class.classForName(Native Method)
    06-01 05:21:12.785: W/System.err(1058): 	at java.lang.Class.forName(Class.java:309)
    06-01 05:21:12.785: W/System.err(1058): 	at java.lang.Class.forName(Class.java:273)
    06-01 05:21:12.785: W/System.err(1058): 	at sonar.systems.framework.SonarFrameworkFunctions.InitFrameworks(SonarFrameworkFunctions.java:161)
    06-01 05:21:12.786: W/System.err(1058): 	at sonar.systems.framework.SonarFrameworkFunctions.<init>(SonarFrameworkFunctions.java:58)
    06-01 05:21:12.786: W/System.err(1058): 	at sonar.systems.framework.SonarFrameworkActivity.onCreate(SonarFrameworkActivity.java:24)
    06-01 05:21:12.786: W/System.err(1058): 	at android.app.Activity.performCreate(Activity.java:5990)
    06-01 05:21:12.786: W/System.err(1058): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
    06-01 05:21:12.794: W/System.err(1058): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
    06-01 05:21:12.794: W/System.err(1058): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)
    06-01 05:21:12.794: W/System.err(1058): 	at android.app.ActivityThread.access$800(ActivityThread.java:151)
    06-01 05:21:12.794: W/System.err(1058): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
    06-01 05:21:12.795: W/System.err(1058): 	at android.os.Handler.dispatchMessage(Handler.java:102)
    06-01 05:21:12.795: W/System.err(1058): 	at android.os.Looper.loop(Looper.java:135)
    06-01 05:21:12.795: W/System.err(1058): 	at android.app.ActivityThread.main(ActivityThread.java:5257)
    06-01 05:21:12.795: W/System.err(1058): 	at java.lang.reflect.Method.invoke(Native Method)
    06-01 05:21:12.795: W/System.err(1058): 	at java.lang.reflect.Method.invoke(Method.java:372)
    06-01 05:21:12.796: W/System.err(1058): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
    06-01 05:21:12.796: W/System.err(1058): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
    06-01 05:21:12.796: W/System.err(1058): Caused by: java.lang.ClassNotFoundException: Didn't find class "sonar.systems.frameworks.Facebook.Facebook" on path: DexPathList[[zip file "/data/app/com.company-1/base.apk"],nativeLibraryDirectories=[/data/app/com.company-1/lib/arm, /vendor/lib, /system/lib]]
    06-01 05:21:12.806: W/System.err(1058): 	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    06-01 05:21:12.806: W/System.err(1058): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
    06-01 05:21:12.810: W/System.err(1058): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
    06-01 05:21:12.810: W/System.err(1058): 	... 19 more
    06-01 05:21:12.810: W/System.err(1058): 	Suppressed: java.lang.ClassNotFoundException: sonar.systems.frameworks.Facebook.Facebook
    06-01 05:21:12.818: W/System.err(1058): 		at java.lang.Class.classForName(Native Method)
    06-01 05:21:12.818: W/System.err(1058): 		at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
    06-01 05:21:12.818: W/System.err(1058): 		at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
    06-01 05:21:12.818: W/System.err(1058): 		at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
    06-01 05:21:12.818: W/System.err(1058): 		... 20 more
    06-01 05:21:12.819: W/System.err(1058): 	Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
    06-01 05:21:12.822: D/AndroidRuntime(1058): Shutting down VM
    06-01 05:21:12.822: D/AndroidRuntime(1058): --------- beginning of crash
    06-01 05:21:12.835: E/AndroidRuntime(1058): FATAL EXCEPTION: main
    06-01 05:21:12.835: E/AndroidRuntime(1058): Process: com.company, PID: 1058
    06-01 05:21:12.835: E/AndroidRuntime(1058): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.company/org.cocos2dx.cpp.AppActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void sonar.systems.framework.SonarFrameworkFunctions.onCreate(android.os.Bundle)' on a null object reference
    06-01 05:21:12.835: E/AndroidRuntime(1058): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
    06-01 05:21:12.835: E/AndroidRuntime(1058): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)
    06-01 05:21:12.835: E/AndroidRuntime(1058): 	at android.app.ActivityThread.access$800(ActivityThread.java:151)
    06-01 05:21:12.835: E/AndroidRuntime(1058): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
    06-01 05:21:12.835: E/AndroidRuntime(1058): 	at android.os.Handler.dispatchMessage(Handler.java:102)
    06-01 05:21:12.835: E/AndroidRuntime(1058): 	at android.os.Looper.loop(Looper.java:135)
    06-01 05:21:12.835: E/AndroidRuntime(1058): 	at android.app.ActivityThread.main(ActivityThread.java:5257)
    06-01 05:21:12.835: E/AndroidRuntime(1058): 	at java.lang.reflect.Method.invoke(Native Method)
    06-01 05:21:12.835: E/AndroidRuntime(1058): 	at java.lang.reflect.Method.invoke(Method.java:372)
    06-01 05:21:12.835: E/AndroidRuntime(1058): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
    06-01 05:21:12.835: E/AndroidRuntime(1058): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
    06-01 05:21:12.835: E/AndroidRuntime(1058): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void sonar.systems.framework.SonarFrameworkFunctions.onCreate(android.os.Bundle)' on a null object reference
    06-01 05:21:12.835: E/AndroidRuntime(1058): 	at sonar.systems.framework.SonarFrameworkActivity.onCreate(SonarFrameworkActivity.java:29)
    06-01 05:21:12.835: E/AndroidRuntime(1058): 	at android.app.Activity.performCreate(Activity.java:5990)
    06-01 05:21:12.835: E/AndroidRuntime(1058): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
    06-01 05:21:12.835: E/AndroidRuntime(1058): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
    06-01 05:21:12.835: E/AndroidRuntime(1058): 	... 10 more
    06-01 05:21:20.061: I/Process(1058): Sending signal. PID: 1058 SIG: 9
    

    I tried it with cocos 3.3 and 3.6, I am using ndk r10d.

    Any help ? Thanks.

  • Sonar Systems admin
    Likes 0

    Do you still have Facebook set to true in the Settings file?

  • Mantas
    Likes 1

    Yeah, I accidentally set Facebook to true and by default USE_MOPUB is set to true it should be false, now everything works fine. Thanks again

  • Sonar Systems admin
    Likes 0

    Great to hear, MoPub in the latest version of GitHub is set to false.

     

    Feel free to post any future questions you may have on this forum.

Login to reply