赞
踩
使用 implementation ‘androidx.appcompat:appcompat:1.7.0’
出现无法运行的问题,编译都没有问题
AGPBI: {“kind”:“error”,“text”:“java.lang.NullPointerException”,“sources”:[{“file”:“C:\Users\10557\.gradle\caches\transforms-4\1edd4499edd7eb0b525a2dccf436f680\transformed\appcompat-resources-1.7.0-runtime.jar”}],“tool”:“D8”}
AGPBI: {“kind”:“error”,“text”:“java.lang.NullPointerException”,“sources”:[{“file”:“C:\Users\10557\.gradle\caches\transforms-4\15b33227282e2c4d2dffa561de8fe63f\transformed\appcompat-1.7.0-runtime.jar”}],“tool”:“D8”}
Execution failed for task ‘:app:mergeExtDexDebug’.
Could not resolve all files for configuration ‘:app:debugRuntimeClasspath’.
Failed to transform appcompat-resources-1.7.0.aar (androidx.appcompat:appcompat-resources:1.7.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=21, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
Execution failed for DexingWithClasspathTransform: C:\Users\10557.gradle\caches\transforms-4\1edd4499edd7eb0b525a2dccf436f680\transformed\appcompat-resources-1.7.0-runtime.jar.
Error while dexing.
Failed to transform appcompat-1.7.0.aar (androidx.appcompat:appcompat:1.7.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=21, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
Execution failed for DexingWithClasspathTransform: C:\Users\10557.gradle\caches\transforms-4\15b33227282e2c4d2dffa561de8fe63f\transformed\appcompat-1.7.0-runtime.jar.
Error while dexing.
把所有的版本修改为1.6.1即可(就很离谱)
implementation ‘androidx.appcompat:appcompat:1.6.1’
在gradle.properties中
android.useAndroidX=true
#android.enableJetifier=true
android.enableBuildCache=false
android.injected.testOnly=false
org.gradle.warning.mode=all
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。