android 应用程序无法安装在版本 9 及更高版本中

android app doesnt install in version 9 and above

大家好,请问我创建的应用程序不能在 android 版本 9、10 和 11 上运行..

我在较低版本上测试了该应用程序,它运行良好,但在版本 9、10 或 11 上测试时,该应用程序一直崩溃

如果我的问题得到解答,我将不胜感激。谢谢

下面是我的build.gradle文件

plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
id 'com.google.firebase.crashlytics'
}


compileSdkVersion 30
buildToolsVersion "30.0.2"

defaultConfig {
    applicationId "com.example.myrevisedlawcoursesapp300level"
    minSdkVersion 19
    targetSdkVersion 30
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    signingConfig signingConfigs.release
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        signingConfig signingConfigs.release

    }
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

`}

`依赖项{

implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.android.support:multidex:2.0.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.gms:play-services-ads:19.7.0'
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-analytics'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

}`

我的 logcat 中的错误消息。我没有从中看到任何线索

02-13 07:21:45.075 308-308/? A/DEBUG: Tombstone written to: /data/tombstones/tombstone_01
02-13 07:22:09.934 30407-30420/? A/libc: Fatal signal 7 (SIGBUS), code 1, fault addr 0xc0011 in tid 30420 (Compiler driver)

02-13 07:22:10.038 308-308/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** ** * *** 02-13 07:22:10.039 308-308/? A/DEBUG: Build fingerprint: 'TCL/5056I/POP455C:6.0.1/MMB29M/vHAJ9-0:user/release-keys' 02-13 07:22:10.039 308-308/? A/DEBUG: Revision: '0' 02-13 07:22:10.039 308-308/? A/DEBUG: ABI: 'arm' 02-13 07:22:10.039 308-308/? A/DEBUG: pid: 30407, tid: 30420, name: Compiler driver >>> /system/bin/dex2oat <<< 02-13 07:22:10.039 308-308/? A/DEBUG: signal 7 (SIGBUS), code 1 (BUS_ADRALN), fault addr 0xc0011 02-13 07:22:10.051 308-308/? A/DEBUG: r0 b1c6004c r1 ffff0006 r2 000c0001 r3 ffff0006 02-13 07:22:10.051 308-308/? A/DEBUG: r4 b1c45638 r5 b1c639ec r6 b1c63af0 r7 00250000 02-13 07:22:10.051 308-308/? A/DEBUG: r8 b1c63958 r9 ffffffff sl b1c63950 fp b1c6395c 02-13 07:22:10.051 308-308/? A/DEBUG: ip b1e522f6 sp b1e522e8 lr b1c60a18 pc b6c56904 cpsr 20070030 02-13 07:22:10.087 308-308/? A/DEBUG: backtrace: 02-13 07:22:10.087 308-308/? A/DEBUG: #00 pc 000e7904 /system/lib/libart-compiler.so (_ZN3art19LocalValueNumbering16HandleInvokeArgsEPKNS_3MIREPKS0_+199) 02-13 07:22:10.087 308-308/? A/DEBUG: #01 pc 000eac3d /system/lib/libart-compiler.so (_ZN3art19LocalValueNumbering14GetValueNumberEPNS_3MIRE+608) 02-13 07:22:10.088 308-308/? A/DEBUG: #02 pc 001badb3 /system/lib/libart-compiler.so (_ZN3art8MIRGraph28ApplyGlobalValueNumberingEndEv+186) 02-13 07:22:10.088 308-308/? A/DEBUG: #03 pc 001bcd9b /system/lib/libart-compiler.so (_ZN3art16PassDriverMEOpts9ApplyPassEPNS_14PassDataHolderEPKNS_4PassE+38) 02-13 07:22:10.088 308-308/? A/DEBUG: #04 pc 0016ecbb /system/lib/libart-compiler.so 02-13 07:22:10.088 308-308/? A/DEBUG: #05 pc 0016f4e7 /system/lib/libart-compiler.so (_ZNK3art13QuickCompiler7CompileEPKNS_7DexFile8CodeItemEjNS_10InvokeTypeEtjP8_jobjectRKS1_+1390) 02-13 07:22:10.088 308-308/? A/DEBUG: #06 pc 0031ed97 /system/lib/libart-compiler.so (_ZN3art14TryFastCompileEPNS_14CompilerDriverEPNS_8CompilerEPKNS_7DexFile8CodeItemEjNS_10InvokeTypeEtjP8_jobjectRKS4_+166) 02-13 07:22:10.088 308-308/? A/DEBUG: #07 pc 0025e279 /system/lib/libart-compiler.so (_ZNK3art18OptimizingCompiler7CompileEPKNS_7DexFile8CodeItemEjNS_10InvokeTypeEtjP8_jobjectRKS1_+180) 02-13 07:22:10.088 308-308/? A/DEBUG: #08 pc 001cb7ef /system/lib/libart-compiler.so (_ZN3art14CompilerDriver13CompileMethodEPNS_6ThreadEPKNS_7DexFile8CodeItemEjNS_10InvokeTypeEtjP8_jobjectRKS3_NS_24DexToDexCompilationLevelEb+1818) 02-13 07:22:10.088 308-308/? A/DEBUG: #09 pc 001cc49b /system/lib/libart-compiler.so (_ZN3art14CompilerDriver12CompileClassEPKNS_26ParallelCompilationManagerEj+1954) 02-13 07:22:10.088 308-308/? A/DEBUG: #10 pc 001c2c95 /system/lib/libart-compiler.so 02-13 07:22:10.088 308-308/? A/DEBUG: #11 pc 00347e11 /system/lib/libart.so (_ZN3art16ThreadPoolWorker3RunEv+256) 02-13 07:22:10.089 308-308/? A/DEBUG: #12 pc 00348449 /system/lib/libart.so (_ZN3art16ThreadPoolWorker8CallbackEPv+52) 02-13 07:22:10.089 308-308/? A/DEBUG: #13 pc 0004169b /system/lib/libc.so (_ZL15__pthread_startPv+30) 02-13 07:22:10.089 308-308/? A/DEBUG: #14 pc 00019275 /system/lib/libc.so (__start_thread+6) 02-13 07:22:10.366 308-308/? A/DEBUG: Tombstone written to: /data/tombstones/tombstone_09 02-1309:06:16.369 8032-8032/? E/AndroidRuntime:致命异常:main Process: com.tcl.antivirus, PID: 8032 java.lang.RuntimeException: Unable to start receiver com.antivirus.ui.privacy.PrivacyAlarmReceiver: java.lang.SecurityException: Permission Denial: opening provider com.android.providers.contacts.CallLogProvider from ProcessRecord{6dab055 8032:com.tcl.antivirus/u0a88} (pid=8032, uid=10088) requires android.permission.READ_CALL_LOG or android.permission.WRITE_CALL_LOG at android.app.ActivityThread.handleReceiver(ActivityThread.java:2732) at android.app.ActivityThread.access00(ActivityThread.java:150) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) Caused by: java.lang.SecurityException: Permission Denial: opening provider com.android.providers.contacts.CallLogProvider from ProcessRecord{6dab055 8032:com.tcl.antivirus/u0a88} (pid=8032, uid=10088) requires android.permission.READ_CALL_LOG or android.permission.WRITE_CALL_LOG at android.os.Parcel.readException(Parcel.java:1620) at android.os.Parcel.readException(Parcel.java:1573) at android.app.ActivityManagerProxy.getContentProvider(ActivityManagerNative.java:3572) at android.app.ActivityThread.acquireProvider(ActivityThread.java:4778) at android.app.ContextImpl$ApplicationContentResolver.acquireUnstableProvider(ContextImpl.java:2018) at android.content.ContentResolver.acquireUnstableProvider(ContentResolver.java:1471) at android.content.ContentResolver.query(ContentResolver.java:477) at android.content.ContentResolver.query(ContentResolver.java:435) at com.antivirus.i.a(Unknown Source) at com.antivirus.privacy.e.b(Unknown Source) at com.antivirus.privacy.e.a(Unknown Source) at com.antivirus.ui.privacy.PrivacyAlarmReceiver.a(Unknown Source) at com.antivirus.ui.privacy.PrivacyAlarmReceiver.onReceive(Unknown Source) at android.app.ActivityThread.handleReceiver(ActivityThread.java:2725) at android.app.ActivityThread.access00(ActivityThread.java:150)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:148)  at android.app.ActivityThread.main(ActivityThread.java:5417)  at java.lang.reflect.Method.invoke(Native Method) 

这里是你的权限问题,在低版本Android下,你安装app时,它保证了所有的权限,但是在最新的Android API中,你必须请求权限在运行时,如果您不这样做,例如尝试读取您应用的存储信息,那么您的应用将会崩溃

我直接在使用 android 版本 9 的 phone 上测试了该应用程序,错误是我将图片添加到错误的资源目录。所以我把图片的位置从mipmap改成了drawable

感谢您的帮助