Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error:Execution failed for task ':gaanaV5_Working:compileDebugJavaWithJavac'. > java.lang.NoSuchMethodError: com.google.common.collect.FluentIterable.join(Lcom/google/common/base/Joiner;)Ljava/lang/String; #2064

Closed
pallavgrover opened this issue Jun 22, 2017 · 8 comments

Comments

@pallavgrover
Copy link

pallavgrover commented Jun 22, 2017

Glide Version:4.0.0-RC1

Integration libraries:

Device/Android Version:

Issue details / Repro steps / Use case background: trying to integrate the latest glide with AppGlideModule but it is getting conflicted with some guava version in google play services getting this error while building the code. Issue is with annotation processor. Attaching log and dependecies added in my gradle.

Stack trace / LogCat:

Error:Execution failed for task ':gaanaV5_Working:compileDebugJavaWithJavac'.
> java.lang.NoSuchMethodError: com.google.common.collect.FluentIterable.join(Lcom/google/common/base/Joiner;)Ljava/lang/String;


 /*Google services*/
        compile 'com.google.android.gms:play-services-plus:10.2.6'
        compile 'com.google.android.gms:play-services-identity:10.2.6'
        compile 'com.google.firebase:firebase-appindexing:10.2.6'
        compile 'com.google.android.gms:play-services-ads:10.2.6'
        compile 'com.google.android.gms:play-services-wallet:10.2.6'
        compile 'com.google.android.gms:play-services-base:10.2.6'
        compile 'com.google.android.gms:play-services-gcm:10.2.6'
        compile 'com.google.android.gms:play-services-location:10.2.6'
        compile 'com.google.android.gms:play-services-analytics:10.2.6'
        compile 'com.google.android.gms:play-services-places:10.2.6'
        compile 'com.google.android.gms:play-services-auth:10.2.6'
        compile 'com.google.apis:google-api-services-people:v1-rev4-1.22.0'
        compile files('libs/now-auth-api.jar')

        /*Google support libraries*/
        compile 'com.android.support:multidex:1.0.1'

        compile 'com.android.support:appcompat-v7:25.3.1'
        compile 'com.android.support:support-v4:25.3.1'
        compile 'com.android.support:design:25.3.1'
        compile 'com.android.support:recyclerview-v7:25.3.1'
        compile 'com.android.support:cardview-v7:25.3.1'
        compile 'com.android.support:support-v13:25.3.1'
        compile 'com.android.support:mediarouter-v7:25.3.1'

        compile 'com.google.api-client:google-api-client:1.22.0'
        compile 'com.google.api-client:google-api-client-android:1.22.0'
        compile 'com.google.code.gson:gson:2.7'

        /*Gaana player */
        compile 'com.google.android.exoplayer:exoplayer:r1.5.3'
        compile files('libs/YouTubeAndroidPlayerApi.jar')
        compile 'com.google.android.gms:play-services-cast:10.2.6'

        /*Analytics sdks*/
        compile files('libs/comscore.jar')
        compile files('libs/apsalar.jar')

        /*Payment sdks*/
        compile project(':citruspay-sdk-ui')
        compile files('libs/PGSDK_V2.0.1.jar')
        compile 'in.juspay:godel:0.6.9.2'
        compile 'in.freecharge.checkout.android:freecharge-checkout-android-sdk:1.0@aar'

        /*Customer support sdk*/
        compile 'com.helpshift:android-helpshift-en-aar:4.8.0'

        /*Notificication sdk*/
        compile 'com.moengage:moe-android-sdk:7.5.01'

        /*Deeplinking sdk*/
        compile 'io.branch.sdk.android:library:1.+'

        /*Colombia sdk*/
        compile 'com.til:colombia-android-sdk:3.2.5'
        compile 'com.til:dmp-pc-android-sdk:1.2.2'

        /*Testing */
        testCompile 'junit:junit:4.12'
        androidTestCompile 'junit:junit:4.12'

        /*Facebook sdk */
        compile 'com.facebook.android:facebook-android-sdk:3.21.1'
        compile 'com.facebook.android:account-kit-sdk:4.+'

        /*Crash sdk*/
        compile 'net.hockeyapp.android:HockeySDK:4.0.1'

        /*Communication libraries*/
        compile files('libs/FortumoInApp-android-9.1.2.jar')
        compile files('libs/httpmime-4.1.jar')

        /*A/B testing sdk*/
        compile files('libs/apptimize-android-2.12.5.jar')

        compile 'org.apache.commons:commons-lang3:3.5'

        compile 'com.github.bumptech.glide:glide:4.0.0-RC1'
        annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0-RC1'
@sjudd
Copy link
Collaborator

sjudd commented Jun 22, 2017

#2059 might be helpful

@pallavgrover
Copy link
Author

I am not able to find which existing library has the same module guava which is conflicting with glide guava annotation processor

@TWiStErRob
Copy link
Collaborator

Can you build with --stacktrace, hoping it would show where the issue is.

@pallavgrover
Copy link
Author

screen shot 2017-06-23 at 12 42 40 am

This is what i get after building with --stacktrace

@TWiStErRob
Copy link
Collaborator

Try command line gradlew assemble --info --stacktrace there must be a Java stack somewhere.

@pallavgrover
Copy link
Author

pallavgrover commented Jun 22, 2017

Hey i solved it finally by adding this
all*.exclude group: 'com.google.guava', module: 'guava-jdk5'

and then adding the guava dependency
compile group: 'com.google.guava', name: 'guava', version: '20.0'

so it removed the jar and used the new one thanks for the help

@jgrife
Copy link

jgrife commented Jun 22, 2017

Just adding guava 20.0 annotationProcessor dependency solved it for me:

annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0-RC1'
annotationProcessor 'com.google.guava:guava:20.0'

@jasonwedepohl
Copy link

jasonwedepohl commented Aug 23, 2017

Good day. I have reproduced this issue with a bare-bones test project (all I did was create a new project, add Glide + google API client library to build.gradle, and add a GlideAppModule class). Guava-related solutions from @pallavgrover and @jgrife did not work for me. Please see build.gradle and build stack trace below. I am using Android Studio 2.3.3.

build.gradle file

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.1"
    defaultConfig {
        applicationId "com.test.glidetest"
        minSdkVersion 21
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.github.bumptech.glide:glide:4.0.0'
    compile 'com.android.support:support-v4:26.0.0-alpha1'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0'

   //build works if this dependency is commented out
    compile('com.google.api-client:google-api-client-android:1.22.0') {
        exclude module: 'httpclient'
    }
}

Gradle build stack trace

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileDebugJavaWithJavac'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:84)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:55)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
        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:46)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
        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:236)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:228)
        at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:61)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:228)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:215)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:77)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:58)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:32)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:113)
        at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
        at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
        at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
        at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
        at org.gradle.initialization.DefaultGradleLauncher$3.execute(DefaultGradleLauncher.java:196)
        at org.gradle.initialization.DefaultGradleLauncher$3.execute(DefaultGradleLauncher.java:193)
        at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:193)
        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:119)
        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:102)
        at org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:71)
        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:49)
        at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:44)
        at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:29)
        at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:47)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
        at org.gradle.util.Swapper.swap(Swapper.java:38)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
        at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
        at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodError: com.google.common.collect.FluentIterable.join(Lcom/google/common/base/Joiner;)Ljava/lang/String;
        at com.sun.tools.javac.main.Main.compile(Main.java:553)
        at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
        at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)
        at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:46)
        at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:33)
        at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:104)
        at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:53)
        at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:38)
        at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:35)
        at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:25)
        at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:206)
        at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:187)
        at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:130)
        at com.android.build.gradle.tasks.factory.AndroidJavaCompile.compile(AndroidJavaCompile.java:49)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:163)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:123)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:95)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:76)
        ... 70 more
Caused by: java.lang.NoSuchMethodError: com.google.common.collect.FluentIterable.join(Lcom/google/common/base/Joiner;)Ljava/lang/String;
        at com.bumptech.glide.annotation.compiler.RequestOptionsGenerator.generateRequestOptionOverride(RequestOptionsGenerator.java:204)
        at com.bumptech.glide.annotation.compiler.RequestOptionsGenerator.access$000(RequestOptionsGenerator.java:72)
        at com.bumptech.glide.annotation.compiler.RequestOptionsGenerator$2.apply(RequestOptionsGenerator.java:187)
        at com.bumptech.glide.annotation.compiler.RequestOptionsGenerator$2.apply(RequestOptionsGenerator.java:184)
        at com.google.common.collect.Lists$TransformingRandomAccessList$1.transform(Lists.java:582)
        at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
        at com.bumptech.glide.annotation.compiler.RequestOptionsGenerator.generate(RequestOptionsGenerator.java:125)
        at com.bumptech.glide.annotation.compiler.AppModuleProcessor.maybeWriteAppModule(AppModuleProcessor.java:87)
        at com.bumptech.glide.annotation.compiler.GlideAnnotationProcessor.process(GlideAnnotationProcessor.java:125)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:794)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:705)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176)
        at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
        at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856)
        at com.sun.tools.javac.main.Main.compile(Main.java:523)
        ... 89 more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants