- Creator 版本:3.6
- 目标平台: Android
我们在使用creator3.6版本做了一个游戏,现在添加广告sdk后。使用推荐的native.bridge.sendToNative和dispatchEventToScript方式进行TS和java交互。
现在调用广告展示,再关闭后,总会出现最下面的一个错误,不知道是不是dispatchEventToScript没有在GLThread执行导致的。?????????
原来用cocos2dx的时候,因为使用是的是 Cocos2dxGLSurfaceView,它继承GLSurfaceView,执行GLThread方式只用调用这个函数即可。现在creator没有这个类了,不知道怎么Java通知TS的函数在GLThread中执行。
@Override
public void runOnGLThread(final Runnable pRunnable) {
this.mGLSurfaceView.queueEvent(pRunnable);
}
错误:
2022-09-08 17
34.799 8479-8678/com.big.game.mete W/cr_MediaCodecBridge: Releasing: OMX.qcom.video.decoder.avc
2022-09-08 17
34.835 8479-8678/com.big.game.mete W/cr_MediaCodecBridge: Codec released
2022-09-08 17
35.095 8479-8529/com.big.game.mete E/chromium: [ERROR:gl_context_virtual.cc(39)] Trying to make virtual context current without decoder.
2022-09-08 17
35.106 8479-8479/com.big.game.mete W/cr_AwContents: Application attempted to call on a destroyed WebView
java.lang.Throwable
at org.chromium.android_webview.AwContents.isDestroyed(AwContents.java:351)
at org.chromium.android_webview.AwContents.isDestroyedOrNoOperation(AwContents.java:323)
at org.chromium.android_webview.AwContents.getTitle(AwContents.java:585)
at org.chromium.android_webview.AwWebContentsDelegateAdapter.loadingStateChanged(AwWebContentsDelegateAdapter.java:132)
at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:9)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5644)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:745)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:635)