Problem record for Android Studio compilation

Source: Internet
Author: User

1, App:transformclasseswithjarmergingfordebug '.

Error:execution failed for task ': App:transformclasseswithjarmergingfordebug '. > com.android.build.transform.api.TransformException:java.util.zip.ZipException:duplicate entry: > Android/support/v7/cardview/buildconfig. class

Workaround:

1. Enter in Terminal:./gradlew clean

2. Select from the menu: Build , clean Project

2, Error:unable to resolve dependency for ': [e-mail Protected]/compileclasspath ': Could not download Junit.jar (junit:junit : 4.12)

<a href= "Openfile:/users/shenjiaqi/documents/sjq/annotation/app/build.gradle" >Open File</a><br ><a href= "Unable to resolve dependency for & #39;: [e-mail protected]/compileclasspath& #39;: Could not Download Junit.jar (junit:junit:4.12) ">show details</a>

Workaround: Make sure that the following statement is included in the app's Build.gradle:

repositories {    Google ()    jcenter ()    ' https://jitpark.io/'}}

The full version is as follows:

Apply plugin: ' Com.android.application 'Android {compilesdkversion27buildtoolsversion' 26.0.2 'Defaultconfig {ApplicationID"Com.sjq.recycletest"minsdkversion15targetsdkversion27Versioncode1Versionname"1.0"Testinstrumentationrunner"Android.support.test.runner.AndroidJUnitRunner"} buildtypes {release {minifyenabledfalseproguardfiles Getdefaultproguardfile (' Proguard-android.txt '), ' Proguard-rules.pro '}} repositories {Google () Jcenter ()} sourcesets {main {Manife St.srcfile' Src/main/androidmanifest.xml 'Java.srcdirs= [' Src/main/java ', ' src/main/aidl '] Resources.srcdirs= [' Src/main/java ', ' src/main/aidl '] Aidl.srcdirs= [' Src/main/aidl '] Res.srcdirs= [' Src/main/res '] Assets.srcdirs= [' Src/main/assets ']}}}dependencies {compile filetree (include: [' *.jar '], dir: ' Libs ') Androidtestcompile (' com.android.support.test.espresso:espresso-core:2.2.2 ', {Exclude group:' Com.android.support ', module: ' Support-annotations '}) Implementation' com.android.support:appcompat-v7:27.1.1 'Implementation' com.android.support:recyclerview-v7:27.1.1 'testimplementation' junit:junit:4.12 '}

3, the comment error annotation processors must is explicitly declared now.

Workaround:

In the build of the app
Android {    ...    Defaultconfig {        ...         // Add the following configuration to be OK         javacompileoptions {annotationprocessoroptions {Includecompileclasspath = True   }}    }    ...}

Problem record for Android Studio compilation

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.