gpt4 book ai didi

java - Android 构建错误 com.google.firebase :firebase-core:16. 0.8

转载 作者:行者123 更新时间:2023-12-02 01:52:03 24 4
gpt4 key购买 nike

尝试将 android 中的项目与 firebase 连接,但是当添加依赖项并运行项目时,出现错误。

我尝试了不同版本的 firebase core 但仍然出现相同的错误消息,我还提高了 API 和最低 SDK 的级别,但它仍然无法运行。

gradle代码是:


buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}

dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.amazonaws.appsync'

repositories {
maven { url 'https://maven.fabric.io/public' }
}

apply plugin: 'com.android.application'

android {
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
compileSdkVersion 28
defaultConfig {
applicationId 'com.example.example'
minSdkVersion 21
targetSdkVersion 28
versionCode 26
versionName "2.5"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-vector-drawable:27.1.1'
implementation 'com.android.support:multidex:1.0.3'
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.nostra13.universalimageloader:universal-image-loader:1.9.5'
implementation 'com.android.support:gridlayout-v7:27.1.1'
implementation 'com.google.android.gms:play-services:11.4.0'
implementation 'com.cepheuen.elegant-number-button:lib:1.0.2'
implementation 'me.anwarshahriar:calligrapher:1.0'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.6@aar') {
transitive = true;
}
implementation 'com.amazonaws:aws-android-sdk-appsync:2.6.+'
implementation 'com.amazonaws:aws-android-sdk-s3:2.6.+'
implementation('com.amazonaws:aws-android-sdk-mobile-client:2.6.+') { transitive = true }
implementation 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.0'
implementation 'org.eclipse.paho:org.eclipse.paho.android.service:1.1.1'
implementation files('libs/java-json.jar')
implementation 'com.google.firebase:firebase-core:16.0.8'
}

apply plugin: 'com.google.gms.google-services'

尝试安装应用程序时显示此错误:

Compilation failed; see the compiler error output for details.

error: cannot access zzbckclass file for com.google.android.gms.internal.zzbck not found

最佳答案

您应该更新到最新版本的 play-services 和 firebase。

此外,您还应该避免使用 bundle 版本的 Google Play 服务。 Google Play 服务 可以有选择地包含,从而实现更小的 APK 大小。

例如

implementation 'com.google.android.gms:play-services-ads:18.1.1'

或者至少

implementation 'com.google.android.gms:play-services:18.0.0'
implementation 'com.google.firebase:firebase-core:17.0.1'

关于java - Android 构建错误 com.google.firebase :firebase-core:16. 0.8,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57420954/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com