gpt4 book ai didi

android - Firebase react-native 无法访问

转载 作者:行者123 更新时间:2023-11-29 16:41:51 24 4
gpt4 key购买 nike

我将 firebase 添加到我的 React native 应用程序中。我正在尝试在 android 中编译它,但我们遇到了问题。我团队的其他成员没有任何问题,他们中有几个人无法运行它,但他们收到了消息。

 basePerformance.java:39: error: cannot access zze
getOrCreateTrace(identifier).start();
^
class file for com.google.android.gms.internal.firebase-perf.zze not found

这听起来像是依赖性问题或类似问题。我们现在正在苦苦挣扎一天,我们对此一无所知。有人可以帮忙吗?这是我们的gradle

android {
compileSdkVersion 27
buildToolsVersion "27.0.3"

defaultConfig {
applicationId "com.ourApp"
minSdkVersion 16
targetSdkVersion 27
versionCode 10
versionName "0.1.6"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
signingConfigs {
release {
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
}
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
}

dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:27.1.1"
implementation "com.facebook.react:react-native:+" // From node_modules
implementation project(':react-native-i18n')
implementation project(':react-native-mail')
implementation project(':react-native-image-picker')
implementation project(':react-native-fast-image')

implementation(project(':react-native-firebase')) {
transitive = false
}

// Firebase dependencies
implementation "com.google.android.gms:play-services-base:15.0.1"
implementation "com.google.firebase:firebase-core:15.0.2"
implementation "com.google.firebase:firebase-messaging:15.0.2"
implementation "com.google.firebase:firebase-analytics:15.0.2"
implementation 'me.leolin:ShortcutBadger:1.1.21@aar'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') {
transitive = true
}
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}

apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
apply plugin: 'com.google.gms.google-services'

最佳答案

我终于解决了这个问题。这是用于编译的Java SDK 的问题。如果您使用 SDK 9 或 10,您将遇到此错误。我将其更改为 Java 8,现在可以正常工作了。

关于android - Firebase react-native 无法访问,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50315823/

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