从cocos3.11.1升级上来的项目,以前在各平台都表现正常,升级为3.15后,
Windows 和 iOS正常,Android下执行如下代码:
std::string mainfestPath = “src/config/project.manifest”;
std::string storagePath = FileUtils::getInstance()->getWritablePath() + “target”;
_am = AssetsManagerEx::create(mainfestPath, storagePath);
_am->retain();
就会崩溃,去掉的话一切正常,@minggo 老师周末在吗?
日志如下:
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: JNI NewGlobalRef called with pending exception ‘java.lang.NoClassDefFoundError’ thrown in unknown throw location
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] in call to NewGlobalRef
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] from void org.cocos2dx.lib.Cocos2dxRenderer.nativeInit(int, int)
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] “GLThread 2387” prio=5 tid=15 Runnable
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] | group=“main” sCount=0 dsCount=0 obj=0x12c336f0 self=0xb4836400
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] | sysTid=17202 nice=0 cgrp=apps sched=0/0 handle=0xb491cb80
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] | state=R schedstat=( 0 0 0 ) utm=114 stm=12 core=1 HZ=100
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] | stack=0xa3167000-0xa3169000 stackSize=1036KB
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] | held mutexes= “mutator lock”(shared held)
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] native: #00 pc 00004f60 /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext*)+23)
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] native: #01 pc 00003665 /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext*)+8)
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] native: #02 pc 00256a61 /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits >&, int, char const*, art::mirror::ArtMethod*)+84)
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] native: #03 pc 00239617 /system/lib/libart.so (art::Dump(std::__1::basic_ostream<char, std::__1::char_traits >&) const+158)
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] native: #04 pc 000b198b /system/lib/libart.so (art::JniAbort(char const*, char const*)+610)
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] native: #05 pc 000b20c5 /system/lib/libart.so (art::JniAbortF(char const*, char const*, …)+68)
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] native: #06 pc 000b537f /system/lib/libart.so (art::ScopedCheck::ScopedCheck(_JNIEnv*, int, char const*)+1346)
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] native: #07 pc 000b673d /system/lib/libart.so (art::CheckJNI::NewGlobalRef(_JNIEnv*, _jobject*)+28)
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] native: #08 pc 00a4e060 /data/app/com.majiang.youle-2/lib/arm/libcocos2dlua.so (_JNIEnv::NewGlobalRef(_jobject*)+40)
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] native: #09 pc 0150b904 /data/app/com.majiang.youle-2/lib/arm/libcocos2dlua.so (cocos2d::network::DownloaderAndroid::DownloaderAndroid(cocos2d::network::DownloaderHints const&)+368)
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] native: #10 pc 01508d14 /data/app/com.majiang.youle-2/lib/arm/libcocos2dlua.so (cocos2d::network::Downloader::Downloader(cocos2d::network::DownloaderHints const&)+124)
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] native: #11 pc 0113d05c /data/app/com.majiang.youle-2/lib/arm/libcocos2dlua.so (cocos2d::extension::AssetsManagerEx::AssetsManagerEx(std::string const&, std::string const&)+1076)
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] native: #12 pc 0113d77c /data/app/com.majiang.youle-2/lib/arm/libcocos2dlua.so (cocos2d::extension::AssetsManagerEx::create(std::string const&, std::string const&)+72)
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] native: #13 pc 009fbc4c /data/app/com.majiang.youle-2/lib/arm/libcocos2dlua.so (Upgrade::init()+1744)
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] native: #14 pc 009fb3ac /data/app/com.majiang.youle-2/lib/arm/libcocos2dlua.so (Upgrade::create(int)+116)
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] native: #15 pc 009e80cc /data/app/com.majiang.youle-2/lib/arm/libcocos2dlua.so (AppDelegate::applicationDidFinishLaunching()+2080)
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] native: #16 pc 00a46f08 /data/app/com.majiang.youle-2/lib/arm/libcocos2dlua.so (cocos2d::Application::run()+40)
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] native: #17 pc 00a4c0ac /data/app/com.majiang.youle-2/lib/arm/libcocos2dlua.so (Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit+224)
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] native: #18 pc 001478ad /data/dalvik-cache/arm/data@app@com.majiang.youle-2@base.apk@classes.dex (Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit__II+88)
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] at org.cocos2dx.lib.Cocos2dxRenderer.nativeInit(Native method)
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] at org.cocos2dx.lib.Cocos2dxRenderer.onSurfaceCreated(Cocos2dxRenderer.java:72)
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1500)
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65] at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1239)
06-10 11:43:49.976: A/art(17178): art/runtime/check_jni.cc:65]
06-10 11:43:50.345: A/art(17178): art/runtime/runtime.cc:314] Runtime aborting…
06-10 11:43:50.345: A/art(17178): art/runtime/runtime.cc:314] Aborting thread:
06-10 11:43:50.345: A/art(17178): art/runtime/runtime.cc:314] “GLThread 2387” prio=5 tid=15 Native
06-10 11:43:50.345: A/art(17178): art/runtime/runtime.cc:314] | group="" sCount=0 dsCount=0 obj=0x12c336f0 self=0xb4836400
06-10 11:43:50.345: A/art(17178): art/runtime/runtime.cc:314] | sysTid=17202 nice=0 cgrp=apps sched=0/0 handle=0xb491cb80
06-10 11:43:50.345: A/art(17178): art/runtime/runtime.cc:314] | state=R schedstat=( 0 0 0 ) utm=118 stm=13 core=1 HZ=100
06-10 11:43:50.345: A/art(17178): art/runtime/runtime.cc:314] | stack=0xa3167000-0xa3169000 stackSize=1036KB
06-10 11:43:50.345: A/art(17178): art/runtime/runtime.cc:314] | held mutexes= “abort lock” “mutator lock”(shared held)
06-10 11:43:50.345: A/art(17178): art/runtime/runtime.cc:314] native: #00 pc 00004f60 /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext*)+23)
06-10 11:43:50.345: A/art(17178): art/runtime/runtime.cc:314] native: #01 pc 00003665 /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext*)+8)
06-10 11:43:50.345: A/art(17178): art/runtime/runtime.cc:314] native: #02 pc 00256a61 /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits >&, int, char const*, art::mirror::ArtMethod*)+84)
06-10 11:43:50.345: A/art(17178): art/runtime/runtime.cc:314] native: #03 pc 00239617 /system/lib/libart.so (art::Dump(std::__1::basic_ostream<char, std::__1::char_traits >&) const+158)
06-10 11:43:50.345: A/art(17178): art/runtime/runtime.cc:314] native: #04 pc 00228f45 /system/lib/libart.so (art::AbortState::DumpThread(std::__1::basic_ostream<char, std::__1::char_traits >&, art::Thread*)+32)
06-10 11:43:50.345: A/art(17178): art/runtime/runtime.cc:314] native: #05 pc 002291e7 /system/lib/libart.so (art::AbortState::Dump(std::__1::basic_ostream<char, std::__1::char_traits >&)+410)
06-10 11:43:50.345: A/art(17178): art/runtime/runtime.cc:314] native: #06 pc 002293a7 /system/lib/libart.so (art::Runtime::Abort()+82)
06-10 11:43:50.345: A/art(17178): art/runtime/runtime.cc:314] native: #07 pc 000a73e1 /system/lib/libart.so (art::LogMessage::~LogMessage()+1360)
06-10 11:43:50.345: A/art(17178): art/runtime/runtime.cc:314] native: #08 pc 000b1b87 /system/lib/libart.so (art::JniAbort(char const*, char const*)+1118)
06-10 11:43:50.345: A/art(17178): art/runtime/runtime.cc:314] native: #09 pc 000b20c5 /system/lib/libart.so (art::JniAbortF(char const*, char const*, …)+68)
06-10 11:43:50.345: A/art(17178): art/runtime/runtime.cc:314] native: #10 pc 000b537f /system/lib/libart.so (art::ScopedCheck::ScopedCheck(_JNIEnv*, int, char const*)+1346)
06-10 11:43:50.345: A/art(17178): art/runtime/runtime.cc:314] native: #11 pc 000b673d /system/lib/libart.so (art::CheckJNI::NewGlobalRef(_JNIEnv*, _jobject*)+28)
06-10 11:43:50.345: A/art(17178): art/runtime/runtime.cc:314] native: #12 pc 00a4e060 /data/app/com.majiang.youle-2/lib/arm/libcocos2dlua.so (_JNIEnv::NewGlobalRef(_jobject*)+40)
06-10 11:43:50.345: A/art(17178): art/runtime/runtime.cc:314] native: #13 pc 0150b904 /data/app/com.majiang.youle-2/lib/arm/libcocos2dlua.so (cocos2d::network::DownloaderAndroid::DownloaderAndroid(cocos2d::network::DownloaderHints const&)+368)
06-10 11:43:50.345: A/art(17178): art/runtime/runtime.cc:314] native: #14 pc 01508d14 /data/app/com.majiang.youle-2/lib/arm/libcocos2dlua.so (cocos2d::network::Downloader::Downloader(cocos2d::network::DownloaderHints const&)+124)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] native: #15 pc 0113d05c /data/app/com.majiang.youle-2/lib/arm/libcocos2dlua.so (cocos2d::extension::AssetsManagerEx::AssetsManagerEx(std::string const&, std::string const&)+1076)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] native: #16 pc 0113d77c /data/app/com.majiang.youle-2/lib/arm/libcocos2dlua.so (cocos2d::extension::AssetsManagerEx::create(std::string const&, std::string const&)+72)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] native: #17 pc 009fbc4c /data/app/com.majiang.youle-2/lib/arm/libcocos2dlua.so (Upgrade::init()+1744)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] native: #18 pc 009fb3ac /data/app/com.majiang.youle-2/lib/arm/libcocos2dlua.so (Upgrade::create(int)+116)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] native: #19 pc 009e80cc /data/app/com.majiang.youle-2/lib/arm/libcocos2dlua.so (AppDelegate::applicationDidFinishLaunching()+2080)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] native: #20 pc 00a46f08 /data/app/com.majiang.youle-2/lib/arm/libcocos2dlua.so (cocos2d::Application::run()+40)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] native: #21 pc 00a4c0ac /data/app/com.majiang.youle-2/lib/arm/libcocos2dlua.so (Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit+224)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] native: #22 pc 001478ad /data/dalvik-cache/arm/data@app@com.majiang.youle-2@base.apk@classes.dex (Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit__II+88)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] at org.cocos2dx.lib.Cocos2dxRenderer.nativeInit(Native method)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] at org.cocos2dx.lib.Cocos2dxRenderer.onSurfaceCreated(Cocos2dxRenderer.java:72)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1500)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1239)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] Pending exception java.lang.NoClassDefFoundError thrown by ‘unknown throw location’
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] java.lang.NoClassDefFoundError: Failed resolution of: Lcom/loopj/android/http/AsyncHttpClient;
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] at void org.cocos2dx.lib.Cocos2dxDownloader.() (Cocos2dxDownloader.java:194)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] at org.cocos2dx.lib.Cocos2dxDownloader org.cocos2dx.lib.Cocos2dxDownloader.createDownloader(int, int, java.lang.String, int) (Cocos2dxDownloader.java:236)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] at void org.cocos2dx.lib.Cocos2dxRenderer.nativeInit(int, int) (Cocos2dxRenderer.java:-2)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] at void org.cocos2dx.lib.Cocos2dxRenderer.onSurfaceCreated(javax.microedition.khronos.opengles.GL10, javax.microedition.khronos.egl.EGLConfig) (Cocos2dxRenderer.java:72)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] at void android.opengl.GLSurfaceView$GLThread.guardedRun() (GLSurfaceView.java:1500)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] at void android.opengl.GLSurfaceView$GLThread.run() (GLSurfaceView.java:1239)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] Caused by: java.lang.ClassNotFoundException: Didn’t find class “com.loopj.android.http.AsyncHttpClient” on path: DexPathList[[zip file “/data/app/com.majiang.youle-2/base.apk”],nativeLibraryDirectories=[/data/app/com.majiang.youle-2/lib/arm, /vendor/lib, /system/lib]]
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:56)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:511)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:469)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] at void org.cocos2dx.lib.Cocos2dxDownloader.() (Cocos2dxDownloader.java:194)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] at org.cocos2dx.lib.Cocos2dxDownloader org.cocos2dx.lib.Cocos2dxDownloader.createDownloader(int, int, java.lang.String, int) (Cocos2dxDownloader.java:236)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] at void org.cocos2dx.lib.Cocos2dxRenderer.nativeInit(int, int) (Cocos2dxRenderer.java:-2)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] at void org.cocos2dx.lib.Cocos2dxRenderer.onSurfaceCreated(javax.microedition.khronos.opengles.GL10, javax.microedition.khronos.egl.EGLConfig) (Cocos2dxRenderer.java:72)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] at void android.opengl.GLSurfaceView$GLThread.guardedRun() (GLSurfaceView.java:1500)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] at void android.opengl.GLSurfaceView$GLThread.run() (GLSurfaceView.java:1239)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] Dumping all threads without appropriate locks held: thread list lock mutator lock
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] All threads:
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] DALVIK THREADS (23):
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] “main” prio=5 tid=1 Native
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] | group="" sCount=0 dsCount=0 obj=0x74d22000 self=0xb4827800
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] | sysTid=17178 nice=0 cgrp=apps sched=0/0 handle=0xb6f6cbec
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] | state=S schedstat=( 0 0 0 ) utm=16 stm=12 core=1 HZ=100
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] | stack=0xbe0ad000-0xbe0af000 stackSize=8MB
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] | held mutexes=
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] kernel: sys_epoll_wait+0x2c8/0x304
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] kernel: sys_epoll_pwait+0xac/0x12c
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] kernel: ret_fast_syscall+0x0/0x30
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] native: #00 pc 0003ae9c /system/lib/libc.so (__epoll_pwait+20)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] native: #01 pc 00015375 /system/lib/libc.so (epoll_pwait+26)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] native: #02 pc 00015383 /system/lib/libc.so (epoll_wait+6)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] native: #03 pc 00012503 /system/lib/libutils.so (android::Looper::pollInner(int)+98)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] native: #04 pc 0001272d /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+92)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] native: #05 pc 000822c9 /system/lib/libandroid_runtime.so (android::NativeMessageQueue::pollOnce(_JNIEnv*, int)+22)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] native: #06 pc 000b5aab /system/framework/arm/boot.oat (Java_android_os_MessageQueue_nativePollOnce__JI+102)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] at android.os.MessageQueue.nativePollOnce(Native method)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] at android.os.MessageQueue.next(MessageQueue.java:143)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] at android.os.Looper.loop(Looper.java:122)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] at android.app.ActivityThread.main(ActivityThread.java:5343)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] at java.lang.reflect.Method.invoke!(Native method)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] at java.lang.reflect.Method.invoke(Method.java:372)
06-10 11:43:50.346: A/art(17178): art/runtime/runtime.cc:314] at