我要添加Firebase Storage来为我的应用上传图像,但是要添加依赖项之后;我收到以下错误:
我的build.gradle(app)看起来像这样。
可惜我无法使用更高版本的SDK作为学校项目,而我们仅限于SDK 19 ...
尝试了一些multidex,但无法正常工作...
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.project.socker"
minSdkVersion 19
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.preference:preference:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'androidx.navigation:navigation-fragment:2.1.0'
implementation 'androidx.navigation:navigation-ui:2.1.0'
def nav_version = "2.1.0"
implementation 'com.google.firebase:firebase-analytics:17.2.1'
implementation 'com.google.firebase:firebase-auth:19.1.0'
implementation 'com.google.firebase:firebase-core:17.2.1'
implementation 'com.google.firebase:firebase-database:19.2.0'
implementation 'com.google.firebase:firebase-storage:19.1.0'
.... \ Socker \ app \ src \ main \ java \ com \ project \ socker \ MainActivity.java: 使用或覆盖已弃用的API。 使用-Xlint:deprecation重新编译以获取详细信息。
OR
无法在单个dex文件中容纳请求的类(#方法:65924> 65536)
答案 0 :(得分:0)
使用了较低的版本,例如 实施'com.google.firebase:firebase-storage:16.0.4'