Solve the Problem of aapt "finished with non-zero exit value 1", aaptnon-zero
Problem description
After using Android Studio to import Eclipse projects recently, the following errors are often reported:
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Vishnu Ruhela\AppData\Local\Android\sdk\build-tools\21.1.2\aapt.exe'' finished with non- zero exit value 1
This inexplicable problem really ruined my three views. Fortunately, after constant efforts and attempts, I still solved it.
Solution 1: Modify the reference method of the application launcher icon
Change from drawable to mipmap:
Right-click res-> New-> Android resourse directory-> select mipmap, step 1;
Right-click mipmap-> New-> Image Asset to complete the remaining operations.
2. Modify manifest
1. Change "@ drawable/ic_launcher" of android: icon to "@ mipmap/ic_launcher"
2. Add tools: replace = "android: icon" to the application. See the following code:
<application android:allowBackup="true" tools:replace="android:icon" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme">
If the tools are marked red, add xmlns: tools = "http://schemas.android.com/tools#to the manifest label.
The specific cause of the problem cannot be further analyzed, but this operation not only conforms to the new application specifications, but also solves my thorny problem.