Tag Archives: aapt

[Solved] Compile Error: AAPT: error: resource android:attr/lStar not found

Question

When using a third-party library, an error is reported during compilation

C:\Users\Administrator\.gradle\caches\transforms-2\files
2.1\b29f469d834fe6ac53c0c0e264e4ef98\core-1.7.0\res\values\values.xml
:105:5-114:25: AAPT: error: resource android:attr/lStar not found.

reason

Compatibility problems have caused the project to be compiled. However, the core-1.7.0 version is used in the third party library and core-1.6.0 is used in the project.

Solution:

Add the following code above dependencies{} in build.gradle

configurations.all {
    resolutionStrategy {
        force 'androidx.core:core:1.6.0'
    }
}

dependencies {
}

Android Error:AAPT: error: resource android:attr/colorError not found

Android resource linking failed
G:\work\viewPager\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:622: error: resource color/colorPrimary (aka com.example.viewpager:color/colorPrimary) not found.
G:\work\viewPager\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:623: error: resource color/colorPrimaryDark (aka com.example.viewpager:color/colorPrimaryDark) not found.
G:\work\viewPager\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:624: error: resource color/colorAccent (aka com.example.viewpager:color/colorAccent) not found.
error: failed linking references.

Reason

25 below compileSdkVersion implementation ‘com. Android. Support: appcompat – v7:27.0.0’ version of the support.
error is usually reported when the compiled version of SDK is lower than the version in the support package, but this is not always true. The error is usually reported when the resource file in the higher version of support package is not found in the lower version of SDK.

solution

changes the compileSdkVersion to be consistent with support, and it is recommended to change the compileSdkVersion 27