"Continuous Update" Android Studio compiles a variety of incurable diseases, always have you want to ~

Source: Internet
Author: User

This blog, just the development of their own often encountered in the packaging and compilation problems and solutions to share a little bit, do not seek attention, but to be useful.

1, we all know that we often encounter the problem of Dex beyond the number of methods, So many people will use Android.support-multidex to solve, but you may encounter the following such a mistake, can not help but let you think, this error is generally introduced a number of the same package, but you open, libs under clearly only a bag ah, let a person headache.

Error:execution failed for task ': App:packagealldebugclassesformultidex '.

> Java.util.zip.ZipException:duplicate Entry:android/support/multidex/multidex.class

The solution is as follows: first delete the jar package below Libs and release the dependency, and then in the Gradle script, add compile ' com.android.support:multidex:1.0.1 '


(Currently the latest version is 1.0.1), successfully resolved.

2, believe that the following problem is also more common, at least the landlord encountered many times, the front did not make notes, engage in every time to understand, so this problem must be summed up, miscellaneous a look is V4 package repeated.

* What went wrong:
Execution failed for task ': App:transformclasseswithjarmergingfordebug '.
> Com.android.build.api.transform.TransformException:java.util.zip.ZipException:duplicate Entry:android/ Support/annotation/colorres.class

The specific solution is: as many third-party packages will use the V4 support package, so when you import multiple support, it is inevitable that this error, just add in Build.gradle

Configurations {

All*.exclude group: ' Com.android.support ', module: ' Support-v4 '

}

Then clean the project and build it. Remember that you must clean, or you will not be able to solve!!

"Continuous Update" Android Studio compiles a variety of incurable diseases, always have you want to ~

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.