-1

请帮忙,如果我向它添加firebase远程配置,我将无法构建我的项目。

我有三种产品风格,我添加了这些依赖项以便能够支持回 api level9

indexLegacyCompile 'com.google.android.gms:play-services-analytics:9.6.1'
indexLegacyCompile 'com.google.android.gms:play-services-location:9.6.1'
indexLegacyCompile 'com.google.android.gms:play-services-gcm:9.6.1'

如果我删除这些行,我可以构建项目。

对于我的正常口味,我添加了播放服务和远程配置,如下所示:

indexCompile 'com.google.android.gms:play-services-analytics:10.2.6'
indexCompile 'com.google.android.gms:play-services-location:10.2.6'
indexCompile 'com.google.android.gms:play-services-gcm:10.2.6'
indexCompile 'com.google.firebase:firebase-config:10.2.6'

我该如何解决?

4

1 回答 1

0

可能是超过 64k 方法的问题https://developer.android.com/studio/build/multidex.html

将此代码添加到您的 gradle ,尝试一下:

android {
    defaultConfig {
        ...
        minSdkVersion 15 
        targetSdkVersion 25
        //add this line
        multiDexEnabled true
    }
    ...
}

dependencies {
  //add this dependencies
  compile 'com.android.support:multidex:1.0.1'
}

希望对你有效。

于 2017-05-31T10:03:51.840 回答