添加新库时出现错误“程序类型已存在:android.support.design.widget.CoordinatorLayout $ Behavior”

时间:2018-05-14 18:59:58

标签: android gradle ucrop

当我尝试将新库添加到项目中然后运行我的应用程序时,我收到此错误:

  

程序类型已存在:android.support.design.widget.CoordinatorLayout $ Behavior

以下是我要添加的库

  1. implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
  2. implementation 'com.github.yalantis:ucrop:2.2.2'
  3. 这是我的应用级Gradle文件

    apply plugin: 'com.android.application'
    
    android {
        compileSdkVersion 26
        defaultConfig {
            applicationId "com.techxee.adarsh.chatbeta"
            minSdkVersion 15
            targetSdkVersion 26
            versionCode 1
            versionName "1.0"
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }
    
    dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar'])
        implementation 'com.android.support:appcompat-v7:27.0.2'
        implementation 'com.android.support.constraint:constraint-layout:1.0.2'
        implementation 'com.google.firebase:firebase-auth:11.8.0'
        implementation 'com.android.support:design:26.1.0'
        implementation 'com.android.support:support-v4:26.1.0'
        implementation 'com.google.firebase:firebase-database:11.8.0'
        implementation 'de.hdodenhof:circleimageview:2.2.0'
        //For firebase UI
        implementation 'com.firebaseui:firebase-ui-database:3.1.3'
        implementation 'com.google.firebase:firebase-storage:11.8.0'
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'com.android.support.test:runner:1.0.1'
        androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
        //For bottom navigation bar
        implementation 'com.aurelhubert:ahbottomnavigation:2.1.0'
        //FOR TAB LAYOUT
        implementation 'com.ogaclejapan.smarttablayout:library:1.6.1@aar'
        //sweet alert dialog
        //implementation 'com.github.f0ris.sweetalert:library:1.5.1'
        //Shine button
        implementation 'com.sackcentury:shinebutton:0.2.0'
        //side menu
        implementation 'com.github.yalantis:Side-Menu.Android:1.0.1'
        implementation 'com.github.ozodrukh:CircularReveal:2.0.1@aar'
        //Image cropper library for the profile image, commented one generates error in compilation
        //implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
        implementation 'com.github.yalantis:ucrop:2.2.2'
    }
    
    apply plugin: 'com.google.gms.google-services'
    

    这是日志:

    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
        at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
        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.run(DefaultTaskGraphExecuter.java:248)
        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:241)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
        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:626)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581)
        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.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\27.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\207.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\208.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\210.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\211.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\216.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\239.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\240.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\241.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\434.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\435.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\436.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\437.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\438.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\439.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\440.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\441.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\442.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\443.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\444.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\445.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\446.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\447.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\449.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\451.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\466.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\467.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\468.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\469.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\470.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\471.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\472.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\473.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\474.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\475.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\476.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\477.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\546.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\551.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\553.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\560.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\561.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\562.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\563.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\564.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\565.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\566.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\567.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\568.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\569.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\570.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\571.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\572.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\573.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\574.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\575.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\576.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\577.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\578.jar
        at com.android.builder.profile.Recorder$Block.handleException(Recorder.java:55)
        at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:104)
        at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:212)
        at sun.reflect.GeneratedMethodAccessor638.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:46)
        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:121)
        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:110)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
        ... 32 more
    Caused by: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\27.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\207.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\208.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\210.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\211.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\216.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\239.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\240.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\241.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\434.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\435.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\436.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\437.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\438.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\439.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\440.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\441.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\442.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\443.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\444.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\445.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\446.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\447.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\449.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\451.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\466.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\467.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\468.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\469.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\470.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\471.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\472.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\473.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\474.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\475.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\476.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\477.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\546.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\551.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\553.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\560.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\561.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\562.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\563.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\564.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\565.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\566.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\567.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\568.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\569.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\570.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\571.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\572.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\573.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\574.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\575.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\576.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\577.jar, H:\Android u Projects\chatBeta\app\build\intermediates\transforms\dexBuilder\debug\578.jar
        at com.android.builder.dexing.D8DexArchiveMerger.getExceptionToRethrow(D8DexArchiveMerger.java:124)
        at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:109)
        at com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:101)
        at com.android.build.gradle.internal.transforms.ExternalLibsMergerTransform.transform(ExternalLibsMergerTransform.kt:123)
        at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:221)
        at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:217)
        at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102)
        ... 47 more
    Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete
        at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:76)
        at com.android.tools.r8.utils.ExceptionUtils.withD8CompilationHandler(ExceptionUtils.java:45)
        at com.android.tools.r8.D8.run(D8.java:67)
        at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:107)
        ... 52 more
    Caused by: com.android.tools.r8.utils.AbortException
        at com.android.tools.r8.utils.Reporter.failIfPendingErrors(Reporter.java:77)
        at com.android.tools.r8.utils.Reporter.fatalError(Reporter.java:58)
        at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:67)
        ... 55 more
    

5 个答案:

答案 0 :(得分:5)

这是因为以下依赖:

implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'

正在使用支持库版本27.1.1(您可以从其project build.gradlemodule build.gradle看到)但是您有混合支持库依赖项版本26和27。

因此,您需要使用匹配的支持库,即版本27.1.1。将build.gradle更改为以下内容:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27 // use version 27
    defaultConfig {
        applicationId "com.techxee.adarsh.chatbeta"
        minSdkVersion 15
        targetSdkVersion 27 // targeting api version 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    ...
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:support-v4:27.1.1'

    // your other library
    // ...

}

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

答案 1 :(得分:3)

我的实例我从

升级
implementation 'com.github.bumptech.glide:glide:4.0.0

implementation 'com.github.bumptech.glide:glide:4.7.1'

我不得不改回旧版本并且它有效。

当事情很糟糕的时候,不要搞砸gradle。它可能是它的屁股。

答案 2 :(得分:3)

只需将support:design:26.1.0更改为:

implementation 'com.android.support:design:27.1.1'

答案 3 :(得分:1)

更新支持:设计:26.1.0至: “ com.android.support:design:27.1.1”为我工作。
高于27.1.1就可以了。
如果仍然无法正常工作,请尝试升级依赖项28

答案 4 :(得分:0)

使用最新的所有supportLibrary(例如版本27.1.1)来解决此问题。为我工作。 (包括许多错误修复程序