我使用 android studio 1.2.1.1,它不会给我新项目的任何错误。
但是对于导入的项目,它会给我一个关于不匹配编码的警告(this issue)。我将项目和 IDE 编码更改为 UTF-8,此警告不再出现。
但是,在那之后,它给了我这个错误。
F:\Work\workspace\NITask\app\build\intermediates\res\debug\drawable-hdpi-v4\ic_launcher.png: error: Duplicate file.
F:\Work\workspace\NITask\app\build\intermediates\res\debug\drawable-hdpi\ic_launcher.png: Original is here. The version qualifier may be implied.
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'D:\sdk\build-tools\22.0.1\aapt.exe'' finished with non-zero exit value 1
在这些项目中,我的主模块中没有 R 类。
我读了很多问题,比如finished with non zero exit value但没有用
更新:
清理项目后,它给我很多关于我的资源的错误,如下所示:
AAPT err(1779619686): F:\Work\workspace\NITask\app\src\main\res\drawable-xhdpi\shadow.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
最佳答案
我有同样的问题,我通过添加来解决它 xmlns:tools="http://schemas.android.com/tools"到 mainfest 文件的顶部,并将 tools:replace="android:icon"添加到应用程序标签。
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" // add tools line here
package="yourpackage">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:replace="android:icon"> //add this line
.....
</application>
</manifest>
关于android - 导入的项目在 android studio 1.2.1.1 中出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30393726/