Android Gradle Compilation error Java finished with Non-zero exit value 2

Source: Internet
Author: User

There are two main types of errors that occur in this error

  • Dependent package Duplication
  • Number of methods over 65K

For the first kind of error, it may be that the Build.gradle wrote

compile fileTree(dir: ‘libs‘, include: [‘*.jar‘])

This way, while adding a separate dependency
For the second cause of the error, using Multidex packaging can solve the problem, add in the Build.gradle

defaultConfig {          multiDexEnabled true }

Can.
The solution is organized from:
Http://stackoverflow.com/questions/29756188/java-finished-with-non-zero-exit-value-2-android-gradle



Wen/Bai Tiancai (Jane book author)
Original link: http://www.jianshu.com/p/4768fe43079a
Copyright belongs to the author, please contact the author to obtain authorization, and Mark "book author".

Android Gradle Compilation error Java finished with Non-zero exit value 2

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.