【发布时间】:2018-08-31 02:44:20
【问题描述】:
当我使用 firestore 版本 11.8.0 时,我的应用程序运行良好,但总是有关于 firestore 版本的警告,它要求我升级最新版本 17.1.0
升级版本后,应用程序显示错误,android studio一直告诉我
//Cannot fit requested classes in a single dex file. Try supplying a main-dexlist.
不知道为什么firebase存储的版本跟Multidex有关系?
这是我的构建等级。
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.moham.trial"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
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.google.firebase:firebase-auth:16.0.3'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.google.firebase:firebase-firestore:17.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:recyclerview-v7:28.0.0-rc02'
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
implementation 'com.android.support:design:28.0.0-rc01'
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.jakewharton:butterknife:8.8.1'
implementation 'com.android.support:cardview-v7:28.0.0-rc02'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
}
apply plugin: 'com.google.gms.google-services'
【问题讨论】:
-
与问题分享您的
build.Gradle -
你现在可以检查一下,我已经用 build gradle 更新了这个问题,谢谢
-
测试用例尝试使用
27.1.1而不是28.0.0-rc02 -
刚刚试了一下,同样的错误
-
使用
classpath 'com.google.gms:google-services:4.0.1'
标签: android firebase google-cloud-firestore android-multidex