Added SdkBox and compile to Android but crashed when open

Added SdkBox and compile to Android but crashed when open
0
#1

Dear all,

I’m using cocos creator 2.0.7 and latest SDKBox 2.4.3.0
The game was running fine in ios, but when I compiled it to Android, it crashed when open. I’ve no idea how to solve this problem, please help. Below are the error messages from Android studio :

01/24 18:41:48: Launching CNY2019
$ adb push /Users/andy/Desktop/project_andy/cocos/cny2019/build/jsb-default/frameworks/runtime-src/proj.android-studio/app/build/outputs/apk/debug/CNY2019-debug.apk /data/local/tmp/com.cyberiod.cny2019
$ adb shell pm install -t -r “/data/local/tmp/com.cyberiod.cny2019”
pkg: /data/local/tmp/com.cyberiod.cny2019
Success

$ adb shell am start -n “com.cyberiod.cny2019/org.cocos2dx.javascript.AppActivity” -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 3169 on device Android_6 [emulator-5554]
Capturing and displaying logcat messages from application. This behavior can be disabled in the “Logcat output” section of the “Debugger” settings page.
I/art: Not late-enabling -Xcheck:jni (already on)
D/Cocos2dxActivity: Cocos2dxActivity onCreate: org.cocos2dx.javascript.AppActivity@87a42c, savedInstanceState: null
D/JniHelper: JniHelper::setJavaVM(0xb40420c0), pthread_self() = -1216525312
D/main: cocos_jni_env_init
D/Cocos2dxHelper: isSupportLowLatency:false
D/Cocos2dxHelper: sampleRate: 44100, framesPerBuffer: 661
D/JniImp: nativeSetAudioDeviceInfo: sampleRate: 44100, bufferSizeInFrames: 661
W/System.err: org.json.JSONException: No value for serviceClassPath
W/System.err: at org.json.JSONObject.get(JSONObject.java:389)
at org.json.JSONObject.getJSONArray(JSONObject.java:584)
at org.cocos2dx.javascript.SDKWrapper.loadSDKClass(SDKWrapper.java:70)
at org.cocos2dx.javascript.SDKWrapper.setGLSurfaceView(SDKWrapper.java:102)
at org.cocos2dx.javascript.AppActivity.onCreateView(AppActivity.java:59)
at org.cocos2dx.lib.Cocos2dxActivity.addSurfaceView(Cocos2dxActivity.java:427)
at org.cocos2dx.lib.Cocos2dxActivity.init(Cocos2dxActivity.java:259)
at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:324)
at com.sdkbox.plugin.SDKBoxActivity.onCreate(SDKBoxActivity.java:11)
at org.cocos2dx.javascript.AppActivity.onCreate(AppActivity.java:39)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
W/System.err: at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
D/Cocos2dxActivity: model=Android SDK built for x86
product=sdk_google_phone_x86
D/Cocos2dxActivity: isEmulator=true
I/SDKBOX_CORE: Sdkbox Droid starting.
Sdkbox got VM.
Sdkbox jni initialized.
D/SDKBOX_CORE: Loaded 0 tracking info _elements.
D/Cocos2dxActivity: onResume()
D/AudioFocusManager: requestAudioFocus succeed
D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
D/: HostConnection::get() New Host Connection established 0xb3153b80, tid 3169
D/: HostConnection::get() New Host Connection established 0xa0f6d3c0, tid 3186
I/OpenGLRenderer: Initialized EGL, version 1.4
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without…
D/EGL_emulation: eglCreateContext: 0xa146f0c0: maj 3 min 0 rcv 3
D/EGL_emulation: eglMakeCurrent: 0xa146f0c0: ver 3 0 (tinfo 0xaf292bc0)
E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf
glUtilsParamSize: unknow param 0x00008824
D/EGL_emulation: eglMakeCurrent: 0xa146f0c0: ver 3 0 (tinfo 0xaf292bc0)
D/: HostConnection::get() New Host Connection established 0xaf2b84c0, tid 3183
D/EGL_emulation: eglCreateContext: 0xa146f2a0: maj 3 min 0 rcv 3
D/EGL_emulation: eglMakeCurrent: 0xa146f2a0: ver 3 0 (tinfo 0xaf292bf0)
E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf
glUtilsParamSize: unknow param 0x00008824
D/main: cocos_android_app_init
D/JniImp: nativeInit: 480, 800,
D/jswrapper: Initializing V8, version: 6.5.254.43
D/jswrapper: libuv version: 1.13.1
D/jswrapper: Debugger listening…, visit [ chrome-devtools://devtools/bundled/inspector.html?v8only=true&ws=0.0.0.0:6086/00010002-0003-4004-8005-000600070008 ] in chrome browser to debug!
For help see https://nodejs.org/en/docs/inspector
D/Cocos2dxActivity: onWindowFocusChanged() hasFocus=true
D/jswrapper: JS: Enable batch GL commands optimization!
V/AsyncHttpClient: Beware! Using the fix is insecure, as it doesn’t verify SSL certificates.
D/cocos2d-x: In the constructor of HttpClient!
D/jswrapper: glGetIntegerv: pname: 0x8b4c
D/jswrapper: JS: Cocos Creator v2.0.7
D/jswrapper: JS: Create unpacker 080aa1695 for 2dL3kvpAxJu6GJ7RdqJG5J
D/jswrapper: JS: Create unpacker 0ca0524ff for ccIRwCoRVK9bM1ipvaT58q
D/jswrapper: JS: Create unpacker 0cf658b0e for b2aHrECZ5APKGS/0d2hvT1
D/jswrapper: JS: Create unpacker 0c6f85ece for a4HaBn7ylHfqOB154UdOdD
JS: Create unpacker 0823eeb0a for aaT59y/ZZGhqJDWx53dB8Y
D/jswrapper: JS: Create unpacker 02e616899 for 0e8fdd1XFOmIrTslH5Pw5N
JS: Create unpacker 0516e46f2 for e0bFT5FwZB/YeXPFOdw/Yl
D/jswrapper: JS: LoadScene 2dL3kvpAxJu6GJ7RdqJG5J: 310.326ms
D/jswrapper: JS: Success to load scene: db://assets/Scene/helloworld.fire
D/jswrapper: JS: Main : onLoad
D/jswrapper: JS: [ERROR]: Error 7002, please go to https://github.com/cocos-creator/engine/blob/master/EngineErrorMap.md#7002 to see details. Arguments: web/index.html
JS: res/raw-assets/web/index.html
D/jswrapper: JS: Main : onEnable()
W/System: ClassLoader referenced unknown path: /system/priv-app/PrebuiltGmsCore/lib/x86
D/jswrapper: JS: Main : start()
W/System: ClassLoader referenced unknown path: /data/data/com.google.android.gms/app_chimera/m/00000001/n/x86
D/DynamitePackage: Instantiated singleton DynamitePackage.
D/DynamitePackage: Instantiating com.google.android.gms.ads.ChimeraAdManagerCreatorImpl
D/jswrapper: JS: ScreenSizeObserver : (576,960)
W/art: Suspending all threads took: 6.701ms
I/art: Background partial concurrent mark sweep GC freed 1329(199KB) AllocSpace objects, 5(648KB) LOS objects, 39% free, 4MB/7MB, paused 14.785ms total 20.624ms
I/art: Background sticky concurrent mark sweep GC freed 19236(1296KB) AllocSpace objects, 22(984KB) LOS objects, 37% free, 4MB/7MB, paused 5.778ms total 9.292ms
I/Ads: Starting ad request.
This request is sent from a test device.
I/WebViewFactory: Loading com.android.webview version 44.0.2403.119 (code 246011910)
W/System: ClassLoader referenced unknown path: /system/app/webview/lib/x86
I/LibraryLoader: Time to load native libraries: 2 ms (timestamps 2224-2226)
Expected native library version number “”,actual native library version number “”
V/WebViewChromiumFactoryProvider: Binding Chromium to main looper Looper (main, tid 1) {f399e3c}
I/LibraryLoader: Expected native library version number “”,actual native library version number “”
I/chromium: [INFO:library_loader_hooks.cc(120)] Chromium logging enabled: level = 0, default verbosity = 0
I/BrowserStartupController: Initializing chromium process, singleProcess=true
W/art: Attempt to remove non-JNI local reference, dumping thread
E/SysUtils: ApplicationContext is null in ApplicationStatus
W/chromium: [WARNING:resource_bundle.cc(285)] locale_file_path.empty()
E/libEGL: validate_display:255 error 3008 (EGL_BAD_DISPLAY)
validate_display:255 error 3008 (EGL_BAD_DISPLAY)
D/EGL_emulation: eglCreateContext: 0xab055ee0: maj 3 min 0 rcv 3
eglMakeCurrent: 0xab055ee0: ver 3 0 (tinfo 0xab83ea80)
E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf
glUtilsParamSize: unknow param 0x00008824
W/AudioManagerAndroid: Requires BLUETOOTH permission
E/DataReductionProxySettingListener: No DRP key due to exception:java.lang.ClassNotFoundException: com.android.webview.chromium.Drp
W/art: Attempt to remove non-JNI local reference, dumping thread
W/AwContents: onDetachedFromWindow called when already detached. Ignoring
W/art: Attempt to remove non-JNI local reference, dumping thread
Attempt to remove non-JNI local reference, dumping thread
W/art: Native thread exiting without having called DetachCurrentThread (maybe it’s going to use a pthread_key_create destructor?): Thread[13,tid=3208,Native,Thread*=0xb317a500,peer=0x12dff0a0,“Thread-156”]
D/JniHelper: JniHelper::getJavaVM(), pthread_self() = -1645217488

         --------- beginning of crash

A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 3183 (GLThread 147)
W/Ads: Invoke Firebase method getInstance error.
The Google Mobile Ads SDK will not integrate with Firebase. Admob/Firebase integration requires the latest Firebase SDK jar, but Firebase SDK is either missing or out of date
D/DynamitePackage: Instantiating com.google.android.gms.ads.ChimeraAdManagerCreatorImpl
I/Ads: Starting ad request.
This request is sent from a test device.
Application terminated.

0 Likes

#2

Let us ask @yinjimmy to take a look at this.

0 Likes

#3

Anyone can help on this?

0 Likes

#5

what sdkbox plugin do you use?

0 Likes

#6

It seems you use AdMob:

        if (cc.sys.isMobile) {
            sdkbox.PluginAdMob.init();
        }

I checked and app works ok. logcat :

        DynamitePackage  D  Instantiating com.google.android.gms.ads.ChimeraAdManagerCreatorImpl
                    Ads  I  Use AdRequest.Builder.addTestDevice("3C2AA5810654DE5351FB66C3F53A424D") to get test ads on this device.
        DynamitePackage  D  Instantiating com.google.android.gms.ads.ChimeraAdManagerCreatorImpl
                    Ads  I  Use AdRequest.Builder.addTestDevice("3C2AA5810654DE5351FB66C3F53A424D") to get test ads on this device.
       cr_LibraryLoader  I  Time to load native libraries: 4 ms (timestamps 5764-5768)
        DynamitePackage  D  Instantiating com.google.android.gms.ads.ChimeraAdManagerCreatorImpl
                    Ads  I  Use AdRequest.Builder.addTestDevice("3C2AA5810654DE5351FB66C3F53A424D") to get test ads on this device.
               chromium  I  [INFO:library_loader_hooks.cc(36)] Chromium logging enabled: level = 0, default verbosity = 0
       cr_LibraryLoader  I  Expected native library version number "71.0.3578.99", actual native library version number "71.0.3578.99"
        DynamitePackage  D  Instantiating com.google.android.gms.ads.reward.ChimeraRewardedVideoAdCreatorImpl
                    Ads  I  Use AdRequest.Builder.addTestDevice("3C2AA5810654DE5351FB66C3F53A424D") to get test ads on this device.
                         W  Update ad debug logging enablement as false
                         W  Not retrying to fetch app settings
                         W  Not retrying to fetch app settings
                         W  Not retrying to fetch app settings
                         W  Not retrying to fetch app settings
      cr_BrowserStartup  I  Initializing chromium process, singleProcess=true
               cr_media  W  Requires BLUETOOTH permission
                 libEGL  E  validate_display:255 error 3008 (EGL_BAD_DISPLAY)
    cr_CrashFileManager  W  /data/user/0/org.cocos2d.helloworld/cache/WebView/Crash Reports does not exist or is not a directory
      VideoCapabilities  W  Unrecognized profile 2130706433 for video/avc
                         I  Unsupported profile 4 for video/mp4v-es
                    Ads  I  Ad failed to load : 3
                         I  Ad failed to load : 3

and another thing, could you plz put your logcat message int

```
``` 

tag.

0 Likes

#7

I have the exact same issue

0 Likes

#8

what’s your dev env and SDKBox plugin version?

0 Likes

#9
admob 2.4.3.3 Doc
firebase 2.4.3.3 Doc
googleplayservices 2.4.3.3 -
iap 2.4.3.3 Doc
sdkboxads 2.4.3.3 Doc
sdkboxplay 2.4.3.3 Doc
0 Likes

#10

runs fine.
could you like to share a test project with me?

0 Likes