1

Issue

Error when I try to config react-native-fcm in my project.

FAILURE: Build failed with an exception. 
What went wrong:
Execution failed for task 
':app:transformClassesWithMultidexlistForDebug'.
com.android.build.api.transform.TransformException: Error while 
generating the main dex list.

Versions

  1. React v16.3.1
  2. react-native v0.55.2
  3. react-native-fcm v14.1.3

Device

Android API 23

Files

I follow step in react-native-fcm to config file

Top-level build.gradle

...
dependencies {
    classpath 'com.android.tools.build:gradle:3.1.0'
    classpath 'com.google.gms:google-services:3.0.0'
}
...

app/build.gradle file

...
android {
    compileSdkVersion 25
    buildToolsVersion '27.0.3'

    defaultConfig {
        applicationId "com.cdan"
        minSdkVersion 16
        targetSdkVersion 25
        multiDexEnabled true
        versionCode 1
        versionName "1.0"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
}
...
dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.android.support:appcompat-v7:23.0.1"
    implementation "com.facebook.react:react-native:+"
    implementation "com.android.support:multidex:1.0.2"

    implementation project(':realm')

    implementation(project(':react-native-maps')){
        exclude group: 'com.google.android.gms', module: 'play-services-base'
        exclude group: 'com.google.android.gms', module: 'play-services-maps'
    }
    implementation 'com.google.android.gms:play-services-base:10.0.1'
    implementation 'com.google.android.gms:play-services-maps:10.0.1'

    compile project(':react-native-fcm')
    compile 'com.google.firebase:firebase-core:10.0.1'
    compile 'com.google.firebase:firebase-messaging:10.0.1'

}

...

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

I tried gradlew clean but it not working.

Thai Ha
  • 1,331
  • 14
  • 21

0 Answers0