InApp Messaging Error
Asked Answered
N

2

2

It gives me Unable to merge dex error. If i comment dependency of InApp Messaging then it works fine.

Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.

java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

    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'

classpath 'com.google.gms:google-services:4.0.0'

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

Let me know if any solution available for it.

Ng answered 17/8, 2018 at 6:24 Comment(0)
N
1

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

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'

It's solved by changing gradle dependency to 3.1.4 version & by integrating multidex.

Ng answered 17/8, 2018 at 7:24 Comment(0)
C
1

Goto: ProjectFolder->.idea->libraries->Delete All

Then Build->Project->Rebuild

Crossgrained answered 17/8, 2018 at 6:28 Comment(1)
Post your build.gradle dependencies . May be there are some conflicts in your gradle files.Crossgrained
N
1

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

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'

It's solved by changing gradle dependency to 3.1.4 version & by integrating multidex.

Ng answered 17/8, 2018 at 7:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.