Android InApp消息传递错误

Android InApp消息传递错误,android,firebase,firebase-in-app-messaging,Android,Firebase,Firebase In App Messaging,它使我无法合并dex错误。如果我对InApp消息传递的依赖性进行注释,那么它可以正常工作 错误:任务“:app:transformDexArchiveWithExternalLibsDexMergerForDebug”的执行失败 java.lang.RuntimeException:java.lang.RuntimeException:com.android.builder.dexing.DexArchiveMergerException:无法合并dex classpath'com.google

它使我无法合并dex错误。如果我对InApp消息传递的依赖性进行注释,那么它可以正常工作

错误:任务“:app:transformDexArchiveWithExternalLibsDexMergerForDebug”的执行失败

java.lang.RuntimeException:java.lang.RuntimeException:com.android.builder.dexing.DexArchiveMergerException:无法合并dex

classpath'com.google.gms:googleservices:4.0.0'

classpath'com.android.tools.build:gradle:3.0.1'


如果有任何解决方案,请告诉我

转到:ProjectFolder->.idea->libraries->Delete All

然后Build->Project->Rebuild

classpath'com.android.tools.build:gradle:3.1.4'


通过将gradle依赖项更改为3.1.4版本&通过集成multidex,可以解决这个问题

发布您的
build.gradle
依赖项。您的gradle文件中可能存在一些冲突。
    implementation 'com.google.firebase:firebase-database:16.0.1'
    implementation 'com.google.firebase:firebase-inappmessaging-display:17.0.0'
    implementation 'com.google.firebase:firebase-core:16.0.1'
apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.firebasedatabasedemo"
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.google.firebase:firebase-database:16.0.1'
    implementation 'com.google.firebase:firebase-inappmessaging-display:17.0.0'


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