【发布时间】:2017-06-20 10:46:41
【问题描述】:
我正在尝试在我已经使用谷歌地图的项目中添加 firebase-messaging。所以当我添加 firebase 依赖时
compile 'com.google.firebase:firebase-messaging:10.0.1'
我收到以下错误。
错误:.dex 文件中的方法引用数不能超过 64K。 在https://developer.android.com/tools/building/multidex.html 了解如何解决此问题 错误:任务“:app:transformClassesWithDexForDebug”执行失败。 com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException
我该如何解决这个问题 这是我的 build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.edesign.astutesol.sallaticustomerapp"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:25.1.1'
compile 'com.mcxiaoke.volley:library:1.0.15'
compile 'com.github.lecho:hellocharts-library:1.5.8@aar'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.android.gms:play-services-auth:10.0.1'
apply plugin: 'com.google.gms.google-services'
compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'com.android.support:cardview-v7:25.+'
compile 'org.lucasr.twowayview:twowayview:0.1.4'
}
这些是谷歌依赖项
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.android.gms:play-services-auth:10.0.1'
apply plugin: 'com.google.gms.google-services'
compile 'com.google.firebase:firebase-messaging:10.0.1'
【问题讨论】:
-
嗨。你有没有看到像one这样讨论错误的帖子?
-
@AL。是的,我尝试了 multiDexEnabled,但它也没有帮助。
-
如果不需要
compile 'com.google.android.gms:play-services:10.0.1',请删除此依赖项。因为,它有 79958 个方法计数。 -
我需要这个来制作地图。我在我的应用程序中使用 latlong。
-
那你需要用这个.... compile 'com.google.android.gms:play-services-maps:10.0.1'
标签: android google-maps android-studio firebase firebase-cloud-messaging