Issues and workarounds for transforming Eclipse projects into Androidstudio projects

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.