当前位置:   article > 正文

使用androidx.appcompat:appcompat:1.7.0无法运行的问题_agpbi: {"kind":"error","text":"java.lang.nullpoint

agpbi: {"kind":"error","text":"java.lang.nullpointerexception","sources":[{

问题:

使用 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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/煮酒与君饮/article/detail/917250
推荐阅读
相关标签
  

闽ICP备14008679号