Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
261 views
in Technique[技术] by (71.8m points)

imported projects give error in android studio 1.2.1.1

i use android studio 1.2.1.1 and it doesn't give me any error for new projects. but for imported projects it gives me an warning about mismatched Encoding (this issue). i changed project and IDE encoding to UTF-8 and this warning doesn't appear any more.
but , after that , it gives me this error.

F:WorkworkspaceNITaskappuildintermediates
esdebugdrawable-hdpi-v4ic_launcher.png: error: Duplicate file.
F:WorkworkspaceNITaskappuildintermediates
esdebugdrawable-hdpiic_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:sdkuild-tools22.0.1aapt.exe'' finished with non-zero exit value 1

and in these projects , there isn't R class in my main module.
i read many questions like finished with non zero exit value but wasn't useful

update:
after clean project , it gives me many error about my resources like this:

AAPT err(1779619686): F:WorkworkspaceNITaskappsrcmain
esdrawable-xhdpishadow.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I had same issue , I fix it by adding xmlns:tools="http://schemas.android.com/tools" to the top of mainfest file , and add tools:replace="android:icon" to application tag.

<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>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...