Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
295 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 Reply

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>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...