Android Build错误:造成原因:java.lang.NoSuchMethodError:com.google.common.util.concurrent.Futures.addCallback

时间:2019-09-13 06:00:42

标签: android gradle build

我试图升级我的android项目中的库,但是现在我收到了错误消息

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:processDebugResources'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:103)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:73)
    at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
    at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
    at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
    at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
    at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
    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.run(DefaultTaskGraphExecuter.java:256)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:249)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:238)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:663)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:597)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.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)
Caused by: java.lang.NoSuchMethodError: com.google.common.util.concurrent.Futures.addCallback(Lcom/google/common/util/concurrent/ListenableFuture;Lcom/google/common/util/concurrent/FutureCallback;)V
    at com.android.builder.internal.aapt.AbstractProcessExecutionAapt.makeValidatedPackage(AbstractProcessExecutionAapt.java:74)
    at com.android.builder.internal.aapt.AbstractAapt.link(AbstractAapt.java:34)
    at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:823)
    at com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask.invokeAaptForSplit(LinkApplicationAndroidResourcesTask.java:534)
    at com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask.doFullTaskAction(LinkApplicationAndroidResourcesTask.java:275)
    at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:106)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    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.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:50)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:124)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:113)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:95)
    ... 33 more

我不知道是哪个库引发了错误。下面是我的build.gradle文件

ext {
    firebaseVersion = '16.0.9'
    v17='17.0.0'
    v19='19.0.0'
    auth='19.0.0'
    ads='18.2.0'
    messaging='20.0.0'
    config="19.0.1"
    db="19.1.0"
    analytics="17.2.0"
}
dependencies {
    implementation "com.google.firebase:firebase-config:${config}"
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation 'com.codemybrainsout.rating:ratingdialog:1.0.7'
    implementation 'com.android.support:appcompat-v7:25.3.1'
    implementation 'com.android.support:recyclerview-v7:25.3.1'
    implementation 'com.android.support:design:25.3.1'
    implementation 'com.android.support:cardview-v7:25.3.1'
    implementation 'com.beardedhen:androidbootstrap:2.3.1'
    implementation 'com.flyco.roundview:FlycoRoundView_Lib:1.1.4@aar'
    implementation 'com.joanzapata.iconify:android-iconify-fontawesome:2.2.2'
    implementation 'cn.pedant.sweetalert:library:1.3'
    implementation 'com.github.gabrielemariotti.cards:cardslib-core:2.1.0'
    implementation 'com.github.satyan:sugar:1.4'
    implementation 'com.android.support.constraint:constraint-layout:1.0.0-alpha8'
//    implementation "com.google.firebase:firebase-core:${firebaseVersion}"
    implementation "com.google.firebase:firebase-analytics:${analytics}"
    implementation "com.google.firebase:firebase-messaging:${messaging}"
    implementation "com.crashlytics.sdk.android:crashlytics:2.10.1"
    implementation "com.google.firebase:firebase-ads:${ads}"
    implementation "com.google.firebase:firebase-database:${db}"
    implementation "com.google.firebase:firebase-auth:${auth}"
    implementation 'com.wdullaer:materialdatetimepicker:3.1.3'
    implementation 'com.yinglan.keyboard:hidekeyboard:1.0.3'
    implementation 'com.yarolegovich:lovely-dialog:1.1.0'
//    implementation 'me.everything:providers-android:1.0.1'
    implementation 'com.github.matthiasrobbers:shortbread:1.0.1'
    implementation 'com.github.paolorotolo:appintro:4.1.0'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.jakewharton:butterknife:8.5.1'
    implementation 'com.squareup.retrofit2:retrofit:2.6.1'
    implementation 'com.github.matthiasrobbers:shortbread:1.0.2'
    annotationProcessor 'com.github.matthiasrobbers:shortbread-compiler:1.0.2'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
    implementation 'com.google.code.gson:gson:2.8.1'
    implementation 'com.squareup.okhttp3:okhttp:4.2.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
    implementation 'com.android.support:multidex:1.0.1'
    implementation 'net.danlew:android.joda:2.9.9'
    implementation 'com.koushikdutta.ion:ion:2.+'
    implementation 'com.github.sujithkanna:smileyrating:1.6.8'
//    implementation 'com.scottyab:aescrypt:0.0.1'
    implementation 'com.github.Q42:AndroidScrollingImageView:1.3.2'
    implementation 'com.github.tozny:java-aes-crypto:1.1.0'
    implementation 'com.samskivert:jmustache:1.14';
    implementation 'com.github.GrenderG:Toasty:1.4.2'
    implementation 'com.google.ads.mediation:facebook:5.5.0.0'

    //If you want to add a network helper
}
apply plugin: 'com.google.gms.google-services'

configurations.all {
    resolutionStrategy {
        force 'com.android.support:design:27.0.2'
        force 'com.android.support:support-v4:27.0.2'
        force 'com.android.support:appcompat-v7:27.0.2'
    }
}

我不知道是怎么回事,出了什么问题,当我回滚更改以升级库时一切正常,但是如果我添加了Facebook中介,则应该对其进行升级,然后引发此错误。

0 个答案:

没有答案