Android Tip: Unable to execute dex:multiple Dex files define Solution

Source: Internet
Author: User

Well, I've thought about not moving Android in the future, but I didn't think it was the reason for the game. Many of the problems with Android are due to eclipse's imperfections, such as the one encountered today unable to execute Dex:multiple Dex files define

[2011-10-23 16:23:29-dex Loader] Unable to execute Dex:multiple Dex files define Lcom/myapp/r$array;
[2011-10-23 16:23:29-myproj] Conversion to Dalvik format failed:unable to execute dex:multiple Dex files define Lcom/myapp/r$array;

Well, the cause of this problem is that everyone should have a different problem, but it's all because of the Eclipse compiler, which can refer to two articles (1.http://blog.csdn.net/asan855/article/details/ 7568702 2.http://stackoverflow.com/questions/7870265/ Unable-to-execute-dex-multiple-dex-files-define-lcom-myapp-rarray)

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/extra/

Here's what I think and the solution:

Reason one: Because there is a problem with APK compilation

WORKAROUND: Delete the bin file directly, eclipse will be automatically generated for you at compile time, and if not, restart Eclipse

Reason two: Duplicate package name

WORKAROUND: There are two possible ways to duplicate package names.

1, one of the two jar names, in the Lib can look, if there is the same delete a.

2. This situation is to be noted. Sometimes the jar name is different, but it will also report this error, because the two jar inside the package name has the same. This requires that we open the jar to see if the package name is duplicated.

The following figure is Android_services_2.2.0.jar, and Android_location_v1.1.2.jar, and the two have no identical packages.

Some thinking: When doing a program, encounter bugs or to understand the principle of their own to find ways, like the second I mentioned above the situation, StackOverflow in fact also did not account for, some things still want to think, do not blindly search the Internet to find the answer, especially in the operation of the egg pain of Android.

Related Article

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.