android studio 打包成功,运行闪退

。。。
。。。
。。。

情况如下图


打包的就改了这里,添加编译文件到android.mk

sdk 版本

ndk 版本
大概情况就是这样,打包hellorwlord 手机可以运行,但是打包项目手机运行就闪退,


打开跟hellowrold也不一样,求解

别沉啊别沉啊

卡在这里好久了

大佬来解救我啊啊啊啊

Resoures中的资源文件没拷贝到asstes文件夹下

打debug包,然后手机或者模拟器连接到android studio,然后查看logcat才可以大概知道原因

09-15 07:22:07.713: E/Surface(2219): getSlotFromBufferLocked: unknown buffer: 0xb4e92020
09-15 07:22:09.731: E/dex2oat(5505): Failed to create oat file: /data/dalvik-cache/arm/data@app@puti.com-2@split_lib_dependencies_apk.apk@classes.dex: Permission denied
09-15 07:22:10.942: E/dex2oat(5511): Failed to create oat file: /data/dalvik-cache/arm/data@app@puti.com-2@split_lib_slice_0_apk.apk@classes.dex: Permission denied
09-15 07:22:11.362: E/dex2oat(5513): Failed to create oat file: /data/dalvik-cache/arm/data@app@puti.com-2@split_lib_slice_1_apk.apk@classes.dex: Permission denied
09-15 07:22:11.771: E/dex2oat(5515): Failed to create oat file: /data/dalvik-cache/arm/data@app@puti.com-2@split_lib_slice_2_apk.apk@classes.dex: Permission denied
09-15 07:22:12.260: E/dex2oat(5517): Failed to create oat file: /data/dalvik-cache/arm/data@app@puti.com-2@split_lib_slice_3_apk.apk@classes.dex: Permission denied
09-15 07:22:12.807: E/dex2oat(5519): Failed to create oat file: /data/dalvik-cache/arm/data@app@puti.com-2@split_lib_slice_4_apk.apk@classes.dex: Permission denied
09-15 07:22:13.207: E/dex2oat(5521): Failed to create oat file: /data/dalvik-cache/arm/data@app@puti.com-2@split_lib_slice_5_apk.apk@classes.dex: Permission denied
09-15 07:22:13.612: E/dex2oat(5523): Failed to create oat file: /data/dalvik-cache/arm/data@app@puti.com-2@split_lib_slice_6_apk.apk@classes.dex: Permission denied
09-15 07:22:14.108: E/dex2oat(5525): Failed to create oat file: /data/dalvik-cache/arm/data@app@puti.com-2@split_lib_slice_7_apk.apk@classes.dex: Permission denied
09-15 07:22:14.590: E/dex2oat(5527): Failed to create oat file: /data/dalvik-cache/arm/data@app@puti.com-2@split_lib_slice_8_apk.apk@classes.dex: Permission denied
09-15 07:22:15.018: E/dex2oat(5529): Failed to create oat file: /data/dalvik-cache/arm/data@app@puti.com-2@split_lib_slice_9_apk.apk@classes.dex: Permission denied
09-15 07:22:15.694: A/libc(5490): Fatal signal 6 (SIGABRT), code -6 in tid 5490 (puti.com)
09-15 07:22:15.826: A/DEBUG(659): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
09-15 07:22:15.827: A/DEBUG(659): Build fingerprint: ‘Android/sdk_google_phone_armv7/generic:6.0/MASTER/3512684:userdebug/test-keys’
09-15 07:22:15.828: A/DEBUG(659): Revision: ‘0’
09-15 07:22:15.828: A/DEBUG(659): ABI: ‘arm’
09-15 07:22:15.833: A/DEBUG(659): pid: 5490, tid: 5490, name: puti.com >>> puti.com <<<
09-15 07:22:15.842: A/DEBUG(659): signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
09-15 07:22:15.924: A/DEBUG(659): r0 00000000 r1 00001572 r2 00000006 r3 b6fcbb7c
09-15 07:22:15.926: A/DEBUG(659): r4 b6fcbb84 r5 b6fcbb34 r6 00000002 r7 0000010c
09-15 07:22:15.926: A/DEBUG(659): r8 abc7ff20 r9 000000aa sl b3c3f1a4 fp beefc164
09-15 07:22:15.928: A/DEBUG(659): ip 00000006 sp beefc058 lr b6d40ef9 pc b6d41bcc cpsr 40000010
09-15 07:22:16.019: A/DEBUG(659): backtrace:
09-15 07:22:16.020: A/DEBUG(659): #00 pc 0003fbcc /system/lib/libc.so (tgkill+12)
09-15 07:22:16.021: A/DEBUG(659): #01 pc 0003eef5 /system/lib/libc.so (pthread_kill+32)
09-15 07:22:16.021: A/DEBUG(659): #02 pc 0001b55b /system/lib/libc.so (raise+10)
09-15 07:22:16.021: A/DEBUG(659): #03 pc 0001870f /system/lib/libc.so (__libc_android_abort+34)
09-15 07:22:16.022: A/DEBUG(659): #04 pc 00017490 /system/lib/libc.so (abort+4)
09-15 07:22:16.022: A/DEBUG(659): #05 pc 00a77f57 /data/app/puti.com-2/lib/arm/libMyGame.so (__gnu_cxx::__verbose_terminate_handler()+230)
09-15 07:22:16.023: A/DEBUG(659): #06 pc 00a46435 /data/app/puti.com-2/lib/arm/libMyGame.so (__cxxabiv1::__terminate(void ()())+4)
09-15 07:22:16.023: A/DEBUG(659): #07 pc 00a4653d /data/app/puti.com-2/lib/arm/libMyGame.so (std::terminate()+8)
09-15 07:22:16.023: A/DEBUG(659): #08 pc 00a466cf /data/app/puti.com-2/lib/arm/libMyGame.so (__cxa_throw+110)
09-15 07:22:16.024: A/DEBUG(659): #09 pc 00a71995 /data/app/puti.com-2/lib/arm/libMyGame.so
09-15 07:22:16.024: A/DEBUG(659): #10 pc 00580bdc /data/app/puti.com-2/lib/arm/libMyGame.so
09-15 07:22:16.025: A/DEBUG(659): #11 pc 00a74d77 /data/app/puti.com-2/lib/arm/libMyGame.so
09-15 07:22:16.025: A/DEBUG(659): #12 pc 004702eb /data/app/puti.com-2/lib/arm/libMyGame.so (cocos2d::FileUtilsAndroid::init()+66)
09-15 07:22:16.026: A/DEBUG(659): #13 pc 00470183 /data/app/puti.com-2/lib/arm/libMyGame.so (cocos2d::FileUtils::getInstance()+58)
09-15 07:22:16.027: A/DEBUG(659): #14 pc 004551c3 /data/app/puti.com-2/lib/arm/libMyGame.so
09-15 07:22:16.027: A/DEBUG(659): #15 pc 004552a7 /data/app/puti.com-2/lib/arm/libMyGame.so
09-15 07:22:16.028: A/DEBUG(659): #16 pc 00002469 /system/bin/linker (__dl__ZN6soinfo13call_functionEPKcPFvvE+48)
09-15 07:22:16.029: A/DEBUG(659): #17 pc 00002535 /system/bin/linker (__dl__ZN6soinfo10call_arrayEPKcPPFvvEjb+136)
09-15 07:22:16.029: A/DEBUG(659): #18 pc 000026f9 /system/bin/linker (__dl__ZN6soinfo17call_constructorsEv+160)
09-15 07:22:16.031: A/DEBUG(659): #19 pc 00006095 /system/bin/linker (__dl__Z9do_dlopenPKciPK17android_dlextinfo+224)
09-15 07:22:16.032: A/DEBUG(659): #20 pc 00001c99 /system/bin/linker (__dl_dlopen+20)
09-15 07:22:16.033: A/DEBUG(659): #21 pc 0024acd5 /system/lib/libart.so (art::JavaVMExt::LoadNativeLibrary(_JNIEnv
, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, _jobject*, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >)+600)
09-15 07:22:16.033: A/DEBUG(659): #22 pc 002bafa7 /system/lib/libart.so (art::Runtime_nativeLoad(_JNIEnv
, _jclass*, _jstring*, _jobject*, _jstring*)+178)
09-15 07:22:16.033: A/DEBUG(659): #23 pc 72ee4395 /data/dalvik-cache/arm/system@framework@boot.oat (offset 0x1eb1000)
09-15 07:22:17.296: A/DEBUG(659): Tombstone written to: /data/tombstones/tombstone_09
09-15 07:22:17.296: E/DEBUG(659): AM write failed: Broken pipe
09-15 07:22:18.233: E/EGL_emulation(2219): tid 2324: eglSurfaceAttrib(1165): error 0x3009 (EGL_BAD_MATCH)
09-15 07:22:19.346: E/EGL_emulation(1002): tid 3489: eglSurfaceAttrib(1165): error 0x3009 (EGL_BAD_MATCH)
09-15 07:24:47.456: E/ActivityThread(2364): Failed to find provider info for com.google.android.wearable.settings
09-15 07:24:52.930: E/cutils-trace(5753): Error opening trace file: No such file or directory (2)
09-15 07:24:54.508: E/CheckinTask(2364): Checkin failed: https://android.clients.google.com/checkin (request #0): java.net.UnknownHostException: Unable to resolve host “android.clients.google.com”: No address associated with hostname
09-15 07:27:18.484: E/Surface(1002): getSlotFromBufferLocked: unknown buffer: 0x981f2e80

出现这样的错误

09-15 21:47:59.481: D/ActivityThread(27702): handleBindApplication:puti.com
09-15 21:47:59.481: D/ActivityThread(27702): setTargetHeapUtilization:0.25
09-15 21:47:59.481: D/ActivityThread(27702): setTargetHeapMinFree:2097152
09-15 21:47:59.481: D/ActivityThread(27702): setTargetHeapConcurrentStart:2097152
09-15 21:47:59.501: V/HwPolicyFactory(27702): : success to get AllImpl object and return…
09-15 21:47:59.511: V/HwWidgetFactory(27702): : successes to get AllImpl object and return…
09-15 21:47:59.521: D/dalvikvm(27702): Trying to load lib /mnt/asec/puti.com-2/lib/libMyGame.so 0x41db34f0
09-15 21:47:59.531: A/libc(27702): Fatal signal 6 (SIGABRT) at 0x00006c36 (code=-6), thread 27702 (puti.com)

目前apk开始运行之后闪退,出来的log信息,
用的android studio 打包的,资源已经在asstes里面了,

我顶我顶我顶我顶

顶顶顶顶

有没有人啊

解决了没,我也遇到了!求解!

求解啊!大哥们!

你的不是编译架构问题吗,打包到模拟器,改成 x86 没好?

对的,没
好,我现在就是打包好的apk 安装完的不对啊!

多给点信息,改成x86,打包到模拟器不对?还是设备?那从 logcat 看这个app启动,崩溃时的日志什么?

05-11 22:42:22.660 1195-1195/? E/HwBastetService: name: com.star.mygame
05-11 22:42:22.865 1195-1241/? E/AwareLog: RMS.AwareIntelligentRecg: delete com.star.mygame from iAware.db
05-11 22:43:04.016 26303-26303/com.star.mygame E/MemoryLeakMonitorManager: MemoryLeakMonitor.jar is not exist!
05-11 22:43:04.017 26303-26303/com.star.mygame E/Minikin: Could not get cmap table size!
05-11 22:43:04.081 26303-26303/com.star.mygame A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 26303 (com.star.mygame)
05-11 22:43:04.111 26330-26330/? A/DEBUG: pid: 26303, tid: 26303, name: com.star.mygame >>> com.star.mygame <<<
05-11 22:43:04.177 26330-26330/? A/DEBUG: #02 pc 009efa8f /data/app/com.star.mygame-bpZXe9xdOpXUSXxUjFp1Kg==/lib/arm/libMyGame.so (_ZN9__gnu_cxx27__verbose_terminate_handlerEv+230)
05-11 22:43:04.177 26330-26330/? A/DEBUG: #03 pc 009bdf71 /data/app/com.star.mygame-bpZXe9xdOpXUSXxUjFp1Kg==/lib/arm/libMyGame.so (_ZN10__cxxabiv111__terminateEPFvvE+4)
05-11 22:43:04.177 26330-26330/? A/DEBUG: #04 pc 009be079 /data/app/com.star.mygame-bpZXe9xdOpXUSXxUjFp1Kg==/lib/arm/libMyGame.so (_ZSt9terminatev+8)
05-11 22:43:04.177 26330-26330/? A/DEBUG: #05 pc 009be20b /data/app/com.star.mygame-bpZXe9xdOpXUSXxUjFp1Kg==/lib/arm/libMyGame.so (__cxa_throw+110)
05-11 22:43:04.177 26330-26330/? A/DEBUG: #06 pc 009e94cd /data/app/com.star.mygame-bpZXe9xdOpXUSXxUjFp1Kg==/lib/arm/libMyGame.so
05-11 22:43:04.177 26330-26330/? A/DEBUG: #07 pc 0056234c /data/app/com.star.mygame-bpZXe9xdOpXUSXxUjFp1Kg==/lib/arm/libMyGame.so
05-11 22:43:04.177 26330-26330/? A/DEBUG: #08 pc 009ec8af /data/app/com.star.mygame-bpZXe9xdOpXUSXxUjFp1Kg==/lib/arm/libMyGame.so
05-11 22:43:04.177 26330-26330/? A/DEBUG: #09 pc 0044a3b7 /data/app/com.star.mygame-bpZXe9xdOpXUSXxUjFp1Kg==/lib/arm/libMyGame.so (_ZN7cocos2d16FileUtilsAndroid4initEv+66)
05-11 22:43:04.177 26330-26330/? A/DEBUG: #10 pc 0044a24f /data/app/com.star.mygame-bpZXe9xdOpXUSXxUjFp1Kg==/lib/arm/libMyGame.so (_ZN7cocos2d9FileUtils11getInstanceEv+58)
05-11 22:43:04.177 26330-26330/? A/DEBUG: #11 pc 0043d68b /data/app/com.star.mygame-bpZXe9xdOpXUSXxUjFp1Kg==/lib/arm/libMyGame.so
05-11 22:43:04.177 26330-26330/? A/DEBUG: #12 pc 0043d76f /data/app/com.star.mygame-bpZXe9xdOpXUSXxUjFp1Kg==/lib/arm/libMyGame.so

就是这玩意,第一次打的时候各种重装系统,稀里糊涂的就好了,现在又来了这个问题

ndkr16,
build tools version 27.0.3
target sdk version 23 andriod 6.0