运行该应用程序时出现此错误。我已经为Firebase身份验证设置了所有设置,但我没有使用电话身份验证,因此此错误似乎有点奇怪。
这是我的android / build.gradle文件。
buildscript {
repositories {
maven {
url 'https://maven.google.com/'
name 'Google'
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:4.0.1'
}
}
这是我的android / app / build.gradle文件
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "com.plastinction"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
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"
}
}
// 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 {
compile(project(':react-native-firebase')) {
transitive = false
}
compile project(':react-native-image-picker')
compile project(':react-native-vector-icons')
compile project(':rn-fetch-blob')
compile project(':react-native-pdf')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
compile 'com.android.support:multidex:1.0.1'
compile "com.facebook.react:react-native:+" // From node_modules
compile 'com.google.firebase:firebase-core:16.0.1'
compile 'com.google.firebase:firebase-auth:11.8.0'
}
这是我的Package.json
"dependencies": {
"firebase": "^5.5.8",
"native-base": "^2.7.1",
"react": "16.3.1",
"react-native": "0.55.4",
"react-native-communications": "^2.1.3",
"react-native-datepicker": "1.7.1",
"react-native-firebase": "3.2.2",
"react-native-image-picker": "0.26.10",
"react-native-loader": "^1.2.1",
"react-native-pdf": "4.0.0",
"react-native-router-flux": "^4.0.1",
"react-native-vector-icons": "^4.6.0",
"rn-fetch-blob": "^0.10.11"
},
"devDependencies": {
"babel-jest": "22.4.4",
"babel-preset-react-native": "4.0.0",
"jest": "22.4.4",
"react-test-renderer": "16.3.1"
}
我的构建成功,但是在加载应用程序时发生此错误,有人可以帮忙吗?
答案 0 :(得分:0)
我通过将firebase依赖项更新到最新版本解决了该问题。 只需添加此内容而不是您的Firebase依赖项:
compile 'com.google.firebase:firebase-core:16.0.4'
compile 'com.google.firebase:firebase-auth:16.0.5'
compile 'com.google.firebase:firebase-database:16.0.5'