Android项目编译异常之AAPT: error

92 阅读1分钟

问题描述

新建个项目报了个错误:C:\Users\LingFeng.gradle\caches\transforms-2\files-2.1\51e7578a0d149e0aa4fac11646699afa\core-1.7.0\res\values\values.xml:105:5-114:25: AAPT: error: resource android:attr/lStar not found. 在这里插入图片描述

解决方案

把androidx的依赖注掉就好了

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation(name:'Alipay_IoTSDK', ext:'aar')
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    //implementation 'androidx.appcompat:appcompat:1.4.1'
    //implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
    testImplementation 'junit:junit:4.12'
    //androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    //androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
    implementation 'com.google.protobuf:protobuf-java:3.5.1'
}