Problem description
Today when running the app through the emulator in Android studio, the following error occurred.
Android resource linking failed
AAPT: D:\developer\androidproject\MyApplication\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
D:\developer\androidproject\MyApplication\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
D:\developer\androidproject\MyApplication\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:2781: error: resource android:attr/fontVariationSettings not found.
D:\developer\androidproject\MyApplication\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:2782: error: resource android:attr/ttcIndex not found.
D:\developer\androidproject\MyApplication\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:3207: error: resource android:attr/textFontWeight not found.
error: failed linking references.
Warning: Android resource linking failed,error: failed linking references。
Troubleshooting
This is usually caused by the project configuration, open File-> Project Structure, and see the modules option as follows:
In the above figure, you will find that the compile sdk version and the build tools version are not the same, so change the build tools version to 26.
This is shown in the figure below:
Run again successfully.
Sometimes, after modifying the above configuration, you will still encounter the error “Android resource linking failed”, but if you look at the build information carefully, you may also encounter another error, as shown in the following marker.
The error reads:
The specified Android SDK Build Tools version (26.0.0) is ignored, as it is below the minimum supported version (29.0.2) for Android Gradle Plugin 4.0.1.
This involves the Android gradle plugin, the specific can refer to the official website, find the matching version.
Similar Posts:
- [Solved] com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
- [Solved] Flutter – AAPT: error: resource android:attr/dialogCornerRadius not found.
- [Solved] Flutter – AAPT: error: resource android:attr/dialogCornerRadiu…
- Can’t find it“ android:Theme.Holo.Light.DarkActionBar ” [How to Solove]
- gradle: failed to find Build Tools revision 23.0.1 [Three Mehods to Solve]
- How to Solve Error:Failed to crunch file
- Manifest Merger failed with multiple errors in Android Studio
- [Solved] No resource found that matches the given name: attr ‘android:keyboardNavigationCluster’. when updati
- Error:(1, 0) Plugin with id ‘android’ not found.
- [Solved] Failed to load D:\Android SDK\android-sdk-windows\build-tools\29.0.3\lib\dx.jar