将Firebase存储作为依赖项添加会导致应用程序崩溃

问题描述 投票:3回答:1

我正在添加Firebase存储以为我的应用上传图像,但是在添加依赖项之后;我收到以下错误:

我的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)

java firebase-storage
1个回答
0
投票

使用了较低的版本,例如实施'com.google.firebase:firebase-storage:16.0.4'

© www.soinside.com 2019 - 2024. All rights reserved.