web-dev-qa-db-fra.com

Problème lors de l'ajout de la messagerie In-App Firebase

J'avais essayé d'ajouter la messagerie in-app Firebase dans notre projet Android. Il se construit avec succès, mais lorsque je lance l'application dans un émulateur/périphérique, l'erreur suivante est générée.

com.Android.builder.dexing.DexArchiveBuilderException: com.Android.builder.dexing.DexArchiveBuilderException: Failed to process /Users/gowthamraj/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/20.0/89507701249388e1ed5ddcf8c41f4ce1be7831ef/guava-20.0.jar
    at Sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at Sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.Java:62)
    at Sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.Java:45)
    at Java.lang.reflect.Constructor.newInstance(Constructor.Java:423)
    at Java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.Java:593)
    at Java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.Java:677)
    at Java.util.concurrent.ForkJoinTask.join(ForkJoinTask.Java:720)
    at com.Android.ide.common.internal.WaitableExecutor.waitForTasksWithQuickFail(WaitableExecutor.Java:146)
    at com.Android.build.gradle.internal.transforms.DexArchiveBuilderTransform.transform(DexArchiveBuilderTransform.Java:405)
    at com.Android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.Java:239)
    at com.Android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.Java:235)
    at com.Android.builder.profile.ThreadRecorder.record(ThreadRecorder.Java:102)
    at com.Android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.Java:230)
    at Sun.reflect.GeneratedMethodAccessor1162.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.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)
    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.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.Java:59)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.Java:130)
    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:46)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.Java:37)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.Java:30)
    at org.gradle.initialization.DefaultGradleLauncher$ExecuteTasks.run(DefaultGradleLauncher.Java:336)
    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.initialization.DefaultGradleLauncher.runTasks(DefaultGradleLauncher.Java:210)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.Java:140)
    at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.Java:115)
    at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.Java:78)
    at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.Java:75)
    at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.Java:152)
    at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.Java:100)
    at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.Java:75)
    at org.gradle.tooling.internal.provider.runner.ClientProvidedBuildActionRunner.run(ClientProvidedBuildActionRunner.Java:62)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.Java:35)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.Java:35)
    at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.Java:32)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$1.run(RunAsBuildOperationBuildActionRunner.Java:43)
    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.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.Java:40)
    at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.Java:51)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.Java:49)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.Java:32)
    at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.Java:39)
    at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.Java:25)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.Java:80)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.Java:53)
    at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.Java:57)
    at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.Java:32)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.Java:36)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.Java:25)
    at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.Java:43)
    at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.Java:29)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.Java:64)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.Java:29)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.Java:59)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.Java:44)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.Java:45)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.Java:30)
    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:122)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.Java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.Java:122)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.Java:26)
    at ...org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.Java:122)
    at Caused by: com.Android.builder.dexing.DexArchiveBuilderException: Error while dexing.
    at com.Android.builder.dexing.D8DexArchiveBuilder.getExceptionToRethrow(D8DexArchiveBuilder.Java:124)
    at com.Android.builder.dexing.D8DexArchiveBuilder.convert(D8DexArchiveBuilder.Java:101)
    at com.Android.build.gradle.internal.transforms.DexArchiveBuilderTransform.launchProcessing(DexArchiveBuilderTransform.Java:895)
    ... 6 more
Caused by: com.Android.tools.r8.CompilationFailedException: Compilation failed to complete
    at com.Android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.Java:65)
    at com.Android.tools.r8.utils.ExceptionUtils.withD8CompilationHandler(ExceptionUtils.Java:43)
    at com.Android.tools.r8.D8.run(D8.Java:90)
    at com.Android.builder.dexing.D8DexArchiveBuilder.convert(D8DexArchiveBuilder.Java:99)
    ... 7 more
Caused by: com.Android.tools.r8.utils.AbortException: Error: Type com.google.common.collect.MapMakerInternalMap$WeakValueReference is referenced as an interface from `com.google.common.collect.MapMakerInternalMap$WeakValueReferenceImpl`.
    at com.Android.tools.r8.utils.Reporter.failIfPendingErrors(Reporter.Java:116)
    at com.Android.tools.r8.utils.Reporter.fatalError(Reporter.Java:74)
    at com.Android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.Java:59)
    ... 10 more

AGPBI: {"kind":"warning","text":"InnerClass annotations are missing corresponding EnclosingMember annotations. Such InnerClass annotations are ignored.","sources":[{}],"tool":"D8"}
:app:transformClassesWithDexBuilderForDebug FAILED
:app:buildInfoGeneratorDebug

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
> com.Android.build.api.transform.TransformException: com.Android.builder.dexing.DexArchiveBuilderException: com.Android.builder.dexing.DexArchiveBuilderException: Failed to process /Users/gowthamraj/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/20.0/89507701249388e1ed5ddcf8c41f4ce1be7831ef/guava-20.0.jar

BUILD FAILED in 28s

Ceci est mon fichier build.gradle

buildscript {
    repositories {
        jcenter()
        maven { url 'https://maven.fabric.io/public' }
        mavenCentral()
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.25.4'
    }
}
apply plugin: 'com.Android.application'
apply plugin: 'io.fabric'


repositories {
    maven { url 'https://maven.fabric.io/public' }
    jcenter()

}

Android {
    buildToolsVersion "28.0.3"
    signingConfigs {
        signingConfigs {
            keyAlias 'betaKey'
            keyPassword 'password'
            storeFile file('./signing/app-beta.jks')
            storePassword 'password'
        }
    }
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.pulsedin.Android"
        minSdkVersion 16
        targetSdkVersion 28
        multiDexEnabled true
        versionCode 8
        versionName "1.2"
        testInstrumentationRunner "Android.support.test.runner.AndroidJUnitRunner"
        manifestPlaceholders = [appPackageName: "${applicationId}"]
        buildConfigField("boolean", "logging_enabled", "${log_enabled}")
        buildConfigField("String", "log_prefix", "\"${log_prefix}\"")
        buildConfigField("String", "client_id", "${client_id}")
        buildConfigField("String", "client_secret", "${client_secret}")
        buildConfigField("String", "grant_type", "${grant_type}")
        buildConfigField("String", "scope_institution", "${scope_institution}")
        buildConfigField("String", "scope_physician", "${scope_physician}")
        buildConfigField("String", "scope_public", "${scope_public}")
        buildConfigField("String", "refresh_token_grant_type", "${refresh_token_grant_type}")
    }
    buildTypes {
        debug {
            debuggable true
            minifyEnabled false
            applicationIdSuffix ".debug"
            resValue("string", "app_name", "${app_name_debug}")
            buildConfigField("String", "app_name", "\"${app_name_debug}\"")
            buildConfigField("String", "api_Host_name", "${dev_api_Host_name}")
            buildConfigField("String", "api_Host_namev2", "${dev_api_Host_namev2}")
        }
        beta {
            debuggable false
            minifyEnabled false
            applicationIdSuffix ".beta"
            proguardFiles getDefaultProguardFile('proguard-Android.txt'), 'proguard-rules.pro'
            resValue("string", "app_name", "${app_name_beta}")
            buildConfigField("String", "app_name", "\"${app_name_beta}\"")
            buildConfigField("String", "api_Host_name", "${beta_api_Host_name}")
            buildConfigField("String", "api_Host_namev2", "${beta_api_Host_namev2}")
            // Added because library modules
            // does not have beta, gamma build type
            matchingFallbacks = ['debug', 'gamma', 'release']
            signingConfig signingConfigs.signingConfigs
        }
        gamma {
            debuggable false
            minifyEnabled false
            applicationIdSuffix ".gamma"
            proguardFiles getDefaultProguardFile('proguard-Android.txt'), 'proguard-rules.pro'
            resValue("string", "app_name", "${app_name_gamma}")
            buildConfigField("String", "app_name", "\"${app_name_gamma}\"")
            buildConfigField("String", "api_Host_name", "${gamma_api_Host_name}")
            buildConfigField("String", "api_Host_namev2", "${gamma_api_Host_namev2}")
            // Added because library modules
            // does not have beta, gamma build type
            matchingFallbacks = ['debug', 'beta', 'release']
        }
        release {
            debuggable false
            minifyEnabled true
            applicationIdSuffix ".release"
            proguardFiles getDefaultProguardFile('proguard-Android.txt'), 'proguard-rules.pro'
            resValue("string", "app_name", "${app_name_release}")
            buildConfigField("String", "app_name", "\"${app_name_release}\"")
            buildConfigField("boolean", "logging_enabled", "${log_disabled}")
            buildConfigField("String", "api_Host_name", "${production_api_Host_name}")
            buildConfigField("String", "api_Host_namev2", "${production_api_Host_namev2}")
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    lintOptions {
        checkReleaseBuilds false
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation "com.Android.support:appcompat-v7:${Android_support_lib_version}"
    implementation "com.Android.support:support-v4:${Android_support_lib_version}"
    implementation "com.Android.support:recyclerview-v7:${Android_support_lib_version}"
    implementation "com.Android.support:cardview-v7:${Android_support_lib_version}"
    implementation "com.Android.support:design:${Android_support_lib_version}"
    implementation 'com.Android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.Android.support.test:runner:1.0.2'
    androidTestImplementation 'com.Android.support.test.espresso:espresso-core:3.0.2'
    configurations.all {
        exclude group: 'com.Android.support', module: 'support-v13'
    }
    implementation('com.crashlytics.sdk.Android:crashlytics:2.6.8@aar') {
        transitive = true
    }

    // Youtube player
    implementation files('libs/YouTubeAndroidPlayerApi.jar')

    // Matisse - image, video picker
    implementation 'com.zhihu.Android:matisse:0.5.1'

    // Glide
    implementation 'com.github.bumptech.glide:glide:4.7.1'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'

    // Butterknife
    implementation 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'

    // Nucleus
    implementation 'info.Android15.nucleus5:nucleus:7.0.0'
    implementation 'info.Android15.nucleus5:nucleus-support-v4:7.0.0'
    implementation 'info.Android15.nucleus5:nucleus-support-v7:7.0.0'

    // RxJava2 and RxAndroid
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'

    // Because RxAndroid releases are few and far between, it is recommended you also

    // explicitly depend on RxJava's latest version for bug fixes and new features.
    implementation 'io.reactivex.rxjava2:rxjava:2.1.14'

    // Retrofit
    implementation 'com.squareup.retrofit2:retrofit:2.4.0'

    // Retrofit - RxJava call adapter
    implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'

    // Retrofit gson converter
    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'

    // Okhttp logging interceptor
    implementation 'com.squareup.okhttp3:logging-interceptor:3.9.0'

    // Easy Permissions
    implementation 'pub.devrel:easypermissions:1.3.0'

    // Photo View - Image zoom
    implementation 'com.github.chrisbanes:PhotoView:2.1.3'

    // Otto - Event Bus
    implementation 'com.squareup:otto:1.3.8'

    // Joda time
    implementation 'joda-time:joda-time:2.9.9'

    // Picasso - Image loading
    implementation 'com.squareup.picasso:picasso:2.71828'

    // Apache commons - Text
    implementation 'org.Apache.commons:commons-text:1.4'

    // Multidex
    implementation 'com.Android.support:multidex:1.0.3'

    // Facebook SDK
    implementation 'com.facebook.Android:facebook-Android-sdk:4.22.0'

    // Firebase messaging
    implementation 'com.google.firebase:firebase-messaging:17.3.4'

    // Google play services
    implementation 'com.google.Android.gms:play-services-maps:16.0.0'
    implementation 'com.google.Android.gms:play-services-location:16.0.0'
    implementation 'com.google.Android.gms:play-services-auth:16.0.1'

    // Google People API
    implementation 'com.google.apis:google-api-services-people:v1-rev2-1.21.0'

    // File upload service
    implementation 'net.gotev:uploadservice:3.4.2'
    implementation 'net.gotev:hostmonitor:2.0@aar'

    // Jsoup - HTML Parsing
    implementation 'org.jsoup:jsoup:1.10.2'

    // Exo player - For video playing
    implementation 'com.google.Android.exoplayer:exoplayer:2.7.0'

    // Image crop,rotate library
    implementation 'com.theartofdev.edmodo:Android-image-cropper:2.7.+'
    //Get pdf Path
    implementation 'com.nbsp:library:1.8'

    // MultiType-FilePicker
    implementation 'com.vincent.filepicker:MultiTypeFilePicker:1.0.8'
    // Local Library modules
    implementation project(':text-editor')
    implementation project(':linkedin-sdk')
    implementation project(':mentions')

    // Add the In-App Messaging dependency:
    implementation 'com.google.firebase:firebase-inappmessaging-display:17.0.4'

    // Check that your Firebase dependency is up-to-date:
    implementation 'com.google.firebase:firebase-core:16.0.5'
}

//Firebase
apply plugin: 'com.google.gms.google-services'

Fichier de niveau de projet:

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.Android.tools.build:gradle:3.2.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        // FCM
        classpath 'com.google.gms:google-services:4.0.1'
    }
}



allprojects {
    repositories {
        google()
        jcenter()
        maven {
            url 'https://repo.Adobe.com/nexus/content/repositories/releases/'
        }
        maven {
            url 'http://maven.localytics.com/public'
        }
        maven {
            url 'https://jitpack.io'
        }
        maven {
            url  "http://dl.bintray.com/lukaville/maven"
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

task indexAssets {
    description 'Index Build Variant assets for faster lookup by AssetManager'

    ext.assetsSrcDir = file("${projectDir}/src/main/assets")

    inputs.dir assetsSrcDir

    doLast {
        Android.applicationVariants.each { target ->
            // create index
            def contents = ""
            def tree = fileTree(dir: "${ext.assetsSrcDir}", include: ['**/*.ttf'], exclude: ['**/.svn/**', '*.index'])
            // use this instead if you have assets folders in each flavor:
            // def tree = fileTree(dir: "${ext.variantPath}", exclude: ['**/.svn/**', '*.index'])
            tree.visit { fileDetails ->
                contents += "${fileDetails.relativePath}" + "\n"
            }

            // create index file
            def assetIndexFile = new File("${ext.assetsSrcDir}/assets.index")
            assetIndexFile.write contents
        }
    }
}

indexAssets.dependsOn {
    tasks.matching { task -> task.name.startsWith('merge') && task.name.endsWith('Assets') }
}

tasks.withType(JavaCompile) {
    compileTask -> compileTask.dependsOn indexAssets
}
7
Gowtham Raj

Essayez d'ajouter guava dependency dans le fichier build.gradle du niveau de l'application, ce qui permet aux outils de construction d'utiliser la dernière version d'Android compatible guava.

dependencies {

    implementation('com.google.firebase:firebase-messaging:17.3.4') {
        exclude group: 'com.google.guava'
    }

    api 'com.google.guava:guava:27.0-Android'
}
2
aminography

dans ce cas, ce n'est pas la goyave tant redoutée - elle ne peut tout simplement pas être ajoutée au classes.dex ...

puisque vous avez minSdkVersion 16 ... vous devez ajouter une dépendance pour la multidex library:

dependencies {
    // implementation "com.Android.support:multidex:1.0.3"
    implementation "androidx.multidex:multidex:2.0.0"
}

c'est à cause de la limite 64k:

Les versions de la plate-forme antérieures à Android 5.0 (API de niveau 21) utilisent le runtime Dalvik pour exécuter le code d'application. Par défaut, Dalvik limite les applications à un seul fichier de bytecode classes.dex par APK.

pour tout autre problème avec ce build.gradle, laissez un commentaire ci-dessous.

edit: pour exclure généralement guava-jdk5, qui peut provenir d'une ancienne bibliothèque:

configurations.all() { configuration ->
    exclude group: "com.google.guava", module :"guava-jdk5"
}
2
Martin Zeitler