任务失败':app:transformClassesWithMultidexlistForDebug'

时间:2018-04-23 04:52:42

标签: android react-native react-native-fcm

问题

我尝试在项目中配置react-native-fcm时出错。

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.

版本

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

    Android API 23

    文件

    我按照react-native-fcm中的步骤配置文件

    顶级build.gradle

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

    app / build.gradle文件

    ...
    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'
    

    我试过了gradlew clean,但它没有用。

0 个答案:

没有答案