如何解决这些cocos2dx游戏崩溃?
以下是回溯:
Fatal Exception: java.lang.AbstractMethodError: abstract method “void
android.content.pm.PackageManager$OnChecksumsReadyListener.onChecksumsReady(java.util.List)”
at android.app.ApplicationPackageManager$2.onChecksumsReady(ApplicationPackageManager.java:1016)
at android.content.pm.IOnChecksumsReadyListener$Stub.onTransact(IOnChecksumsReadyListener.java:87)
at android.os.Binder.execTransactInternal(Binder.java:1220)
at android.os.Binder.execTransact(Binder.java:1179)
这是游戏机崩溃造成的。出现在cocos2dx 3.17.2游戏中。
[libMyGame.so] cocos2d::Sequence::update(float)
pid: 0, tid: 0 >>> com.company.DemoGame <<<
backtrace:
#00 pc 0x00000000002ac08c /data/app/com.company.DemoGame-wFz3_4vUXhkLB6m5XdqJJQ==/lib/arm/libMyGame.so
#01 pc 0x00000000002e0f7d /data/app/com.company.DemoGame-wFz3_4vUXhkLB6m5XdqJJQ==/lib/arm/libMyGame.so (cocos2d::Sequence::update(float)+278)
#02 pc 0x00000000002e0f23 /data/app/com.company.DemoGame-wFz3_4vUXhkLB6m5XdqJJQ==/lib/arm/libMyGame.so (cocos2d::Sequence::update(float)+188)
#03 pc 0x00000000002e0f23 /data/app/com.company.DemoGame-wFz3_4vUXhkLB6m5XdqJJQ==/lib/arm/libMyGame.so (cocos2d::Sequence::update(float)+188)
#04 pc 0x00000000002e0a5d /data/app/com.company.DemoGame-wFz3_4vUXhkLB6m5XdqJJQ==/lib/arm/libMyGame.so (cocos2d::ActionInterval::step(float)+112)
#05 pc 0x0000000000392e93 /data/app/com.company.DemoGame-wFz3_4vUXhkLB6m5XdqJJQ==/lib/arm/libMyGame.so (cocos2d::ActionManager::update(float)+94)
#06 pc 0x00000000002e539b /data/app/com.company.DemoGame-wFz3_4vUXhkLB6m5XdqJJQ==/lib/arm/libMyGame.so (std::__ndk1::function<void (float)>::operator()(float) const+18)
#07 pc 0x000000000035d87b /data/app/com.company.DemoGame-wFz3_4vUXhkLB6m5XdqJJQ==/lib/arm/libMyGame.so (cocos2d::Scheduler::update(float)+94)
#08 pc 0x000000000034ff97 /data/app/com.company.DemoGame-wFz3_4vUXhkLB6m5XdqJJQ==/lib/arm/libMyGame.so (cocos2d::Director::drawScene()+42)
#09 pc 0x00000000003514a5 /data/app/com.company.DemoGame-wFz3_4vUXhkLB6m5XdqJJQ==/lib/arm/libMyGame.so (cocos2d::Director::mainLoop()+44)
#10 pc 0x000000000006cb37 /data/app/com.company.DemoGame-wFz3_4vUXhkLB6m5XdqJJQ==/oat/arm/base.odex (org.cocos2dx.lib.Cocos2dxRenderer.nativeDeleteBackward [DEDUPED]+94)
#11 pc 0x000000000006da4b /data/app/com.company.DemoGame-wFz3_4vUXhkLB6m5XdqJJQ==/oat/arm/base.odex (org.cocos2dx.lib.Cocos2dxRenderer.onDrawFrame+210)
#12 pc 0x00000000009d7929 /system/framework/arm/boot-framework.oat (android.opengl.GLSurfaceView$GLThread.guardedRun+3040)
#13 pc 0x00000000009d876d /system/framework/arm/boot-framework.oat (android.opengl.GLSurfaceView$GLThread.run+180)
#14 pc 0x000000000042e975 /system/lib/libart.so (art_quick_invoke_stub_internal+68)
#15 pc 0x0000000000401821 /system/lib/libart.so (art_quick_invoke_stub+224)
#16 pc 0x00000000000a82b9 /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+136)
#17 pc 0x000000000035e9cd /system/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+52)
#18 pc 0x000000000035f725 /system/lib/libart.so (art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue*)+320)
#19 pc 0x0000000000381203 /system/lib/libart.so (art::Thread::CreateCallback(void*)+866)
#20 pc 0x0000000000064d55 /system/lib/libc.so (__pthread_start(void*)+22)
#21 pc 0x000000000001ec41 /system/lib/libc.so (__start_thread+24)
我认为代码中Sequence::create(….CC_CALLBACK_..)附近的问题。