首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >依赖项的问题是什么?我正在使用androidX

依赖项的问题是什么?我正在使用androidX
EN

Stack Overflow用户
提问于 2019-11-15 04:11:42
回答 2查看 481关注 0票数 1

,这是我的模块应用程序。我认为firebaseUi依赖是导致错误的原因,但我不确定。谁来帮帮忙。

代码语言:javascript
运行
复制
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.2'

    implementation 'com.google.android.material:material:1.0.0'

    implementation 'com.firebaseui:firebase-ui-database:6.0.2'

    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.firebase:firebase-auth:16.0.5'
    implementation 'com.google.firebase:firebase-database:16.0.4'

    implementation 'com.google.firebase:firebase-core:16.0.4'

    implementation 'androidx.cardview:cardview:1.0.0'


    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}

应用程序崩溃,这是生成的堆栈跟踪的一部分

代码语言:javascript
运行
复制
 11-11 11:19:05.890 18032-18032/? E/Zygote: MountEmulatedStorage()
11-11 11:19:05.890 18032-18032/? E/Zygote: v2
11-11 11:19:05.900 18032-18032/? E/SELinux: [DEBUG] get_category: variable seinfo: default sensitivity: NULL, cateogry: NULL
11-11 11:19:06.320 18032-18032/com.example.mytasks E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.mytasks, PID: 18032
    java.lang.NoClassDefFoundError: com.google.firebase.auth.internal.zzae
        at com.google.firebase.auth.FirebaseAuth.zzcb(Unknown Source)
        at com.google.firebase.auth.FirebaseAuth.zza(Unknown Source)
        at com.google.firebase.auth.FirebaseAuth.<init>(Unknown Source)
        at com.google.firebase.auth.FirebaseAuth.<init>(Unknown Source)
        at com.google.firebase.auth.internal.zzj.<init>(Unknown Source)
        at com.google.firebase.auth.zzp.create(Unknown Source)
EN

回答 2

Stack Overflow用户

发布于 2019-11-15 04:17:28

我猜您错过了根级(项目级) Gradle文件中的一些依赖项。检查一下你是否有这些:

代码语言:javascript
运行
复制
buildscript {

  repositories {
    // Check that you have the following line (if not, add it):
    google()  // Google's Maven repository
  }

  dependencies {
    // ...

    // Add the following line:
    classpath 'com.google.gms:google-services:4.3.3'  // Google Services plugin
  }
}

allprojects {
  // ...

  repositories {
    // Check that you have the following line (if not, add it):
    google()  // Google's Maven repository
    // ...
  }
}
票数 1
EN

Stack Overflow用户

发布于 2019-11-15 04:44:03

显然,你似乎在使用不支持androidx的旧版本。

这里的解决方案是使用最新版本。

代码语言:javascript
运行
复制
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.2'

    implementation 'com.google.android.material:material:1.0.0'

    implementation 'com.firebaseui:firebase-ui-database:6.1.0'

    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.firebase:firebase-auth:19.1.0'
    implementation 'com.google.firebase:firebase-database:19.2.0'

//  No longer required implementation 'com.google.firebase:firebase-core:17.2.1' 

    implementation 'com.google.firebase:firebase-analytics:17.2.1'
    implementation 'androidx.cardview:cardview:1.0.0'


    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}

请参阅最新的版本,

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58870224

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档