Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to compile under Android Studio 3.0 Canary 1

I attempt to compile my Android project under AS 3.0 Canary 1 (it works fine on AS 2.3.2 stable version) but failed with the following error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:packageInstantRunResourcesUatGoogleDebug'.
> com.google.common.util.concurrent.MoreExecutors.directExecutor()Ljava/util/concurrent/Executor;

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:packageInstantRunResourcesUatGoogleDebug'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:98)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:68)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:60)
    at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
    at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:248)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:239)
    at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:114)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:239)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:226)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:120)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:77)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:101)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:95)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:527)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:95)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: org.gradle.tooling.BuildException: com.google.common.util.concurrent.MoreExecutors.directExecutor()Ljava/util/concurrent/Executor;
    at com.android.build.gradle.internal.scope.SplitScope.lambda$parallelForEachOutput$10(SplitScope.java:243)
    at com.android.build.gradle.internal.scope.SplitScope.parallelForEachOutput(SplitScope.java:238)
    at com.android.build.gradle.internal.scope.SplitScope.parallelForEachOutput(SplitScope.java:198)
    at com.android.build.gradle.internal.scope.SplitScope.parallelForEachOutput(SplitScope.java:182)
    at com.android.build.gradle.tasks.PackageAndroidArtifact.doFullTaskAction(PackageAndroidArtifact.java:301)
    at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:80)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
    at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:161)
    at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:132)
    at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:121)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.execute(ExecuteActionsTaskExecuter.java:115)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.execute(ExecuteActionsTaskExecuter.java:109)
    at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:114)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:109)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:90)
    ... 26 more
Caused by: java.lang.NoSuchMethodError: com.google.common.util.concurrent.MoreExecutors.directExecutor()Ljava/util/concurrent/Executor;
    at com.android.apkzlib.zip.ZFile.createSources(ZFile.java:1586)
    at com.android.apkzlib.zip.ZFile.makeStoredEntry(ZFile.java:1546)
    at com.android.apkzlib.zip.ZFile.add(ZFile.java:1625)
    at com.android.apkzlib.zfile.ApkZFileCreator.writeFile(ApkZFileCreator.java:141)
    at com.android.builder.internal.packaging.IncrementalPackager.updateFiles(IncrementalPackager.java:170)
    at com.android.builder.internal.packaging.IncrementalPackager.updateAssets(IncrementalPackager.java:229)
    at com.android.build.gradle.tasks.PackageAndroidArtifact.doTask(PackageAndroidArtifact.java:525)
    at com.android.build.gradle.tasks.PackageAndroidArtifact.splitFullAction(PackageAndroidArtifact.java:359)
    at com.android.build.gradle.internal.scope.SplitScope.lambda$parallelForEachOutput$6(SplitScope.java:187)
    at com.android.build.gradle.internal.scope.SplitScope.lambda$parallelForEachOutput$7(SplitScope.java:204)
    at com.android.build.gradle.internal.scope.SplitScope.lambda$null$8(SplitScope.java:226)
    at com.android.ide.common.internal.WaitableExecutor.waitForAllTasks(WaitableExecutor.java:215)
    at com.android.build.gradle.internal.scope.SplitScope.parallelForEachOutput(SplitScope.java:237)
    ... 41 more
    Suppressed: java.lang.NoSuchMethodError: com.google.common.util.concurrent.MoreExecutors.directExecutor()Ljava/util/concurrent/Executor;
        at com.android.apkzlib.zip.ZFile.createSources(ZFile.java:1586)
        at com.android.apkzlib.zip.ZFile.makeStoredEntry(ZFile.java:1546)
        at com.android.apkzlib.zip.ZFile.add(ZFile.java:1625)
        at com.android.apkzlib.zip.ZFile.add(ZFile.java:1499)
        at com.android.apkzlib.sign.ManifestGenerationExtension.updateManifest(ManifestGenerationExtension.java:241)
        at com.android.apkzlib.sign.ManifestGenerationExtension.access$000(ManifestGenerationExtension.java:52)
        at com.android.apkzlib.sign.ManifestGenerationExtension$1.lambda$beforeUpdate$0(ManifestGenerationExtension.java:168)
        at com.android.apkzlib.zip.ZFile.notify(ZFile.java:2099)
        at com.android.apkzlib.zip.ZFile.update(ZFile.java:871)
        at com.android.apkzlib.zip.ZFile.close(ZFile.java:1161)
        at com.android.apkzlib.zfile.ApkZFileCreator.close(ApkZFileCreator.java:172)
        at com.google.common.io.Closer.close(Closer.java:213)
        at com.android.builder.internal.packaging.IncrementalPackager.close(IncrementalPackager.java:330)
        at com.android.build.gradle.tasks.PackageAndroidArtifact.doTask(PackageAndroidArtifact.java:535)
        at com.android.build.gradle.tasks.PackageAndroidArtifact.splitFullAction(PackageAndroidArtifact.java:359)
        at com.android.build.gradle.internal.scope.SplitScope.lambda$parallelForEachOutput$6(SplitScope.java:187)
        at com.android.build.gradle.internal.scope.SplitScope.lambda$parallelForEachOutput$7(SplitScope.java:204)
        at com.android.build.gradle.internal.scope.SplitScope.lambda$null$8(SplitScope.java:226)
        at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
        at java.util.concurrent.ForkJoinTask.externalAwaitDone(ForkJoinTask.java:326)
        at java.util.concurrent.ForkJoinTask.doJoin(ForkJoinTask.java:391)
        at java.util.concurrent.ForkJoinTask.join(ForkJoinTask.java:719)
        at com.android.ide.common.internal.WaitableExecutor.waitForAllTasks(WaitableExecutor.java:215)
        at com.android.build.gradle.internal.scope.SplitScope.parallelForEachOutput(SplitScope.java:237)
        at com.android.build.gradle.internal.scope.SplitScope.parallelForEachOutput(SplitScope.java:198)
        at com.android.build.gradle.internal.scope.SplitScope.parallelForEachOutput(SplitScope.java:182)
        at com.android.build.gradle.tasks.PackageAndroidArtifact.doFullTaskAction(PackageAndroidArtifact.java:301)
        at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:80)
        at sun.reflect.GeneratedMethodAccessor387.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:161)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:132)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:121)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.execute(ExecuteActionsTaskExecuter.java:115)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.execute(ExecuteActionsTaskExecuter.java:109)
        at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:114)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:109)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:90)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:68)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:60)
        at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
        at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:248)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:239)
        at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:114)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:239)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:226)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:120)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:77)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:101)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:95)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:527)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:95)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
        at java.lang.Thread.run(Thread.java:745)


BUILD FAILED in 2s
18 actionable tasks: 6 executed, 12 avoided (67%)

I am not sure if that is related to the guava 19.0 library I imported. The libraries I used are listed below:

dependencies {
    compile fileTree(include: ['*.jar'], excludes: ["pushservice-${baiduLibVersion}.jar", 'native-libs.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile("com.android.support:appcompat-v7:${supportLibVersion}") {
        exclude module: 'support-v4'
    }
    compile "com.android.support:support-fragment:${supportLibVersion}"
    compile "com.android.support:design:${supportLibVersion}"
    compile "com.android.support:percent:${supportLibVersion}"
    compile "com.android.support:gridlayout-v7:${supportLibVersion}"
    compile "com.google.android.gms:play-services-analytics:${playServiceLibVersion}"

    compile "com.google.firebase:firebase-messaging:${playServiceLibVersion}"
    // Cloud Messaging and Notifications
    compile "com.google.firebase:firebase-crash:${playServiceLibVersion}"
    compile "com.google.firebase:firebase-appindexing:${playServiceLibVersion}"
    compile "com.google.android.gms:play-services-auth:${playServiceLibVersion}"
    // google account login
    compile "com.google.android.gms:play-services-location:${playServiceLibVersion}"

    compile('com.github.AndroidDeveloperLB:AutoFitTextView:3') {
        exclude group: 'com.android.support', module: 'appcompat-v7'
    }
    compile('com.github.ksoichiro:android-observablescrollview:1.6.0') {
        exclude group: 'com.android.support', module: 'recyclerview-v7'
    }
    compile('com.bignerdranch.android:expandablerecyclerview:2.1.1') {
        exclude group: 'com.android.support', module: 'recyclerview-v7'
    }
    compile('com.facebook.android:facebook-android-sdk:4.13.2') {
        exclude group: 'com.android.support', module: 'support-v4'
    }
    compile 'com.android.support:multidex:1.0.1'
    compile 'in.co.ophio:secure-preferences:0.1.3'
    compile 'com.squareup.retrofit2:retrofit:2.1.0'
    compile 'com.squareup.retrofit2:converter-gson:2.1.0'
    compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
    compile 'com.squareup.okhttp3:okhttp:3.4.1'
    compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
    compile 'com.google.code.gson:gson:2.7'
    compile 'com.google.dagger:dagger:2.7'
    compile 'com.squareup.phrase:phrase:1.1.0'
    compile 'org.apache.commons:commons-lang3:3.4'
    compile 'javax.annotation:javax.annotation-api:1.2'
    compile 'uk.co.chrisjenx:calligraphy:2.2.0'
    compile 'com.githang:com-phillipcalvin-iconbutton:2.0.2'
    compile 'com.github.seanzor:shared-preferences-helper:1.1.0'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'com.github.bumptech.glide:okhttp3-integration:1.4.0@jar'
    compile 'com.github.aakira:expandable-layout:1.6.0@aar'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'org.parceler:parceler-api:1.1.5'
    compile 'io.reactivex:rxandroid:1.2.1'
    compile 'io.reactivex:rxjava:1.1.6'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'org.apmem.tools:layouts:1.10@aar'
    compile 'com.bigkoo:pickerview:2.1.1'
    compile 'com.newrelic.agent.android:android-agent:5.7.1'
    compile 'com.google.guava:guava:19.0'
    compile 'com.dlazaro66.qrcodereaderview:qrcodereaderview:2.0.1'
    compile 'com.vdurmont:semver4j:2.0.2'
    testCompile 'junit:junit:4.12'
    annotationProcessor 'com.google.dagger:dagger-compiler:2.7'
    annotationProcessor 'org.parceler:parceler:1.1.5'
    checkstyle 'com.puppycrawl.tools:checkstyle:6.5'
}
like image 212
chubao Avatar asked May 22 '17 03:05

chubao


People also ask

What is Canary version of Android studio?

The IDE for Android (Canary build) Android Studio provides the fastest tools for building apps on every type of Android device. World-class code editing, debugging, performance tooling, a flexible build system, and an instant build/deploy system all allow you to focus on building unique and high quality apps.

What is compile in Android Studio?

The Android build system compiles app resources and source code, and packages them into APKs or Android App Bundles that you can test, deploy, sign, and distribute.


2 Answers

The problem is the new Android plugin version 3.0.0-alpha1

Just revert the plugin to 2.3 or 2.4-alpha7 and use gradle 3.5, it will work with the Firebase Plugin

like image 27
Michael B. Avatar answered Oct 13 '22 00:10

Michael B.


Firebase team have suggested to use this as a fix :

classpath ('com.google.firebase:firebase-plugins:1.1.0') {
    exclude group: 'com.google.guava', module: 'guava-jdk5'
}

EDIT: Including the new updated package will auto-exclude the guava-jdk5 package.

classpath 'com.google.firebase:firebase-plugins:1.1.1'
like image 134
Mohamed ALOUANE Avatar answered Oct 12 '22 23:10

Mohamed ALOUANE