Having Force Close with Targeted SDK

147 views Asked by At

I have a problem with this source (Ringdroid: https://github.com/google/ringdroid ), last month I update my app wich targeted on android 23, but I just realise when I launch my app with android 23,24,25 it give me force close, so i change my targeted sdk to 22 but google play store says it can happen because previous version is targeted to 23. question is, it is a bug ? i need my project targeted on android 23 and still give me force close when i open using emulator or smartphone using marsmallow or nougat. how to fix this, sorry about my english

P.S.: when i change target sdk to 22 or above, it absouletly normal no force close happen.

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
1

There are 1 answers

0
OneCricketeer On

It's not a bug at all. You need to add permission handling correctly into your code starting at API 23.

If the device is running Android 6.0 or higher, and your app's target SDK is 23 or higher: The app has to list the permissions in the manifest, and it must request each dangerous permission it needs while the app is running

Android | Requesting Permissions at Run Time