Tag Archives: Android Studio Compile error

[Solved] Android Studio Compile Error: Process ‘command ‘ finished with non-zero exit value 1

problem analysis

Errors occur when compiling. Generally, it is process’ command ‘C:\users…\appdata\local\Android\SDK\build tools\27.0.3\AAPT.Exe’ finished with non zero exit value 1

This is mostly a problem with the resource file. It is a newly imported project that has not been compiled before.

Solution:

In fact, it’s very simple. What we need is positioning
enter gradlew processdebugresources — debug in the termianl interface of as, and press enter to debug the resources, and the specific log will be printed if there is a problem.

gradlew processDebugResources –debug

After debugging, turn up and find the reason for the error

[Solved] Android Studio Compile error: Android resource linking failed

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.