使用目标 SDK 强制关闭

问题描述 投票:0回答:1

我对此源有疑问(Ringdroid:https://github.com/google/ringdroid),上个月我更新了针对 Android 23 的应用程序,但当我使用 Android 23 启动我的应用程序时我才意识到,24,25 它给了我强制关闭的机会,所以我将目标 SDK 更改为 22,但 Google Play 商店说这可能会发生,因为以前的版本是针对 23 的。

问题是,这是一个错误吗?我需要我的项目针对 Android 23,并且当我使用模拟器或使用 Marshmellow 或牛轧糖的智能手机打开时,仍然强制关闭。如何解决这个问题,对不起我的英语

P.S.:当我将目标SDK更改为22或更高版本时,绝对正常,不会发生强制关闭。

03-12 02:46:05.141 15526-15526/? I/art: Not late-enabling -Xcheck:jni (already on)
03-12 02:46:05.205 15526-15526/com.ringdroid W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/com.ringdroid-1/split_lib_dependencies_apk.apk --oat-file=/data/dalvik-cache/x86/data@[email protected]@[email protected]) because non-0 exit status
03-12 02:46:05.220 15526-15526/com.ringdroid W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/com.ringdroid-1/split_lib_slice_0_apk.apk --oat-file=/data/dalvik-cache/x86/data@[email protected]@[email protected]) because non-0 exit status
03-12 02:46:05.250 15526-15526/com.ringdroid W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/com.ringdroid-1/split_lib_slice_1_apk.apk --oat-file=/data/dalvik-cache/x86/data@[email protected]@[email protected]) because non-0 exit status
03-12 02:46:05.262 15526-15526/com.ringdroid W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/com.ringdroid-1/split_lib_slice_2_apk.apk --oat-file=/data/dalvik-cache/x86/data@[email protected]@[email protected]) because non-0 exit status
03-12 02:46:05.273 15526-15526/com.ringdroid W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/com.ringdroid-1/split_lib_slice_3_apk.apk --oat-file=/data/dalvik-cache/x86/data@[email protected]@[email protected]) because non-0 exit status
03-12 02:46:05.283 15526-15526/com.ringdroid W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/com.ringdroid-1/split_lib_slice_4_apk.apk --oat-file=/data/dalvik-cache/x86/data@[email protected]@[email protected]) because non-0 exit status
03-12 02:46:05.294 15526-15526/com.ringdroid W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/com.ringdroid-1/split_lib_slice_5_apk.apk --oat-file=/data/dalvik-cache/x86/data@[email protected]@[email protected]) because non-0 exit status
03-12 02:46:05.303 15526-15526/com.ringdroid W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/com.ringdroid-1/split_lib_slice_6_apk.apk --oat-file=/data/dalvik-cache/x86/data@[email protected]@[email protected]) because non-0 exit status
03-12 02:46:05.312 15526-15526/com.ringdroid W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/com.ringdroid-1/split_lib_slice_7_apk.apk --oat-file=/data/dalvik-cache/x86/data@[email protected]@[email protected]) because non-0 exit status
03-12 02:46:05.329 15526-15526/com.ringdroid W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/com.ringdroid-1/split_lib_slice_8_apk.apk --oat-file=/data/dalvik-cache/x86/data@[email protected]@[email protected]) because non-0 exit status
03-12 02:46:05.339 15526-15526/com.ringdroid W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/com.ringdroid-1/split_lib_slice_9_apk.apk --oat-file=/data/dalvik-cache/x86/data@[email protected]@[email protected]) because non-0 exit status
03-12 02:46:05.340 15526-15526/com.ringdroid W/System: ClassLoader referenced unknown path: /data/app/com.ringdroid-1/lib/x86
03-12 02:46:05.341 15526-15526/com.ringdroid I/InstantRun: Starting Instant Run Server for com.ringdroid
03-12 02:51:21.753 15526-20262/com.ringdroid D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
03-12 02:51:21.766 15526-20260/com.ringdroid E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
                                                               Process: com.ringdroid, PID: 15526
                                                               java.lang.RuntimeException: An error occurred while executing doInBackground()
                                                                   at android.os.AsyncTask$3.done(AsyncTask.java:309)
                                                                   at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
                                                                   at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
                                                                   at java.util.concurrent.FutureTask.run(FutureTask.java:242)
                                                                   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
                                                                   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
                                                                   at java.lang.Thread.run(Thread.java:818)
                                                                Caused by: java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/audio/media from pid=15526, uid=10124 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
                                                                   at android.os.Parcel.readException(Parcel.java:1599)
                                                                   at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183)
                                                                   at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
                                                                   at android.content.ContentProviderProxy.query(ContentProviderNative.java:421)
                                                                   at android.content.ContentResolver.query(ContentResolver.java:491)
                                                                   at android.content.CursorLoader.loadInBackground(CursorLoader.java:64)
                                                                   at android.content.CursorLoader.loadInBackground(CursorLoader.java:56)
                                                                   at android.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:312)
                                                                   at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:69)
                                                                   at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:66)
                                                                   at android.os.AsyncTask$2.call(AsyncTask.java:295)
                                                                   at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                                                                   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
                                                                   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
                                                                   at java.lang.Thread.run(Thread.java:818) 
03-12 02:51:22.079 15526-20262/com.ringdroid I/OpenGLRenderer: Initialized EGL, version 1.4
03-12 02:51:22.240 15526-20262/com.ringdroid E/Surface: getSlotFromBufferLocked: unknown buffer: 0xaaa72470
03-12 02:56:22.073 15526-20260/com.ringdroid I/Process: Sending signal. PID: 15526 SIG: 9
java android ringdroid
1个回答
0
投票

这根本不是一个错误。您需要从 API 23 开始将权限处理正确添加到代码中。

如果设备运行的是 Android 6.0 或更高版本,并且您的应用程序的目标 SDK 为 23 或更高版本:应用程序必须在清单中列出权限,并且它必须在应用程序运行时请求所需的每个危险权限

安卓 |在运行时请求权限

© www.soinside.com 2019 - 2024. All rights reserved.