It was not the first time that the Eclipse project was converted to a Androidstudio project, and there were several problems when we turned yesterday:
First, the project is imported into the Androidstudio, after the completion of the error:
Question one :
Error:java.util.concurrent.ExecutionException:com.android.ide.common.process.ProcessException:
Error:execution failed for task ': App:mergedebugresources '.
> Error:java.util.concurrent.ExecutionException:com.android.ide.common.process.ProcessException:
The cause of the problem : I look at concurrent and contracted the exception, there will certainly be a lot of circumstances can lead to this anomaly. What I met was the. 9 chart that caused the problem. Androidstudio will make a strict check on the. 9 chart, not satisfying the format. 9 figure will not be compiled;
Obviously this picture is not. 9, the name is: Unread_dot.9.png, so the compilation does not pass;
workaround : web-based configuration such as http:// www.jianshu.com/p/f046b3f49e49;http://www.cnblogs.com/wangfeng520/p/6119531.html
configuration I have not tried, I directly use Androidstudio draw9patch to change the problem picture into a. 9.png image;
question two :
error: (1, 1) Error: Illegal character: ' \ufeff '
error: (1, 10) Error: Requires class, interface, or enum
problem reason : Eclipse can intelligently convert Utf-8+bom files to normal UTF-8 files, Android Studio does not work, so compile errors
Workaround : Use other document editing tools to convert Utf-8+bom encoded files to normal UTF-8 files. For example, I open the file with EditPlus: File-->save as--> Select UTF-8 encoding, overwrite save
question three :
Error:execution failed for task ': App:transformresourceswithmergejavaresfordebug '.
> com.android.build.api.transform.TransformException:com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK Meta-inf/license
File1:c:\users\administrator\desktop\qhfpsj\firstsecretaryshowinfo\landpatrolsys\app\libs\ Jackson-core-1.9.5.jar
File2:c:\users\administrator\desktop\qhfpsj\firstsecretaryshowinfo\landpatrolsys\app\libs\ Jackson-mapper-1.9.5.jar
cause of the problem : It appears that multiple jar packages contain the same files (LICENSE.txt), resulting in an error when packaging because of concerns about mutual coverage.
workaround : taste Try adding a configuration to the Android part of Build.gradle in the app, as shown in the following code:
packagingoptions { ' meta-inf/license '}
Continue to Error:
Error:execution failed for task ': App:transformresourceswithmergejavaresfordebug '.
> com.android.build.api.transform.TransformException:com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK meta-inf/lgpl2.1
File1:c:\users\administrator\desktop\qhfpsj\firstsecretaryshowinfo\landpatrolsys\app\libs\ Jackson-core-1.9.5.jar
File2:c:\users\administrator\desktop\qhfpsj\firstsecretaryshowinfo\landpatrolsys\app\libs\ Jackson-mapper-1.9.5.jar
Add another sentence: Exclude ' meta-inf/lgpl2.1 '
And then compile it, and the project will be up and running.
Issues and workarounds for transforming Eclipse projects into Androidstudio projects