我是 firebase 和 flutter 的新手。我正在看一個視頻,我決定使用 flutter 和 firebase 制作一個提醒應用程式,但是一旦我連接資料庫,就會出現以下錯誤。
W/GooglePlayServicesUtil(27206): com.learnflutter.firebasee 需要 Google Play 商店,但它不見了。E/GooglePlayServicesUtil(27206):由于錯誤 9 W/Firestore(27206):(23.0.4) [GrpcCallProvider]:無法更新 ssl 背景關系:com.google.android.gms.common.GooglePlayServicesNotAvailableException W/utter,GooglePlayServices 不可用.firebase(27206): 訪問隱藏方法 Lcom/android/org/conscrypt/OpenSSLSocketImpl;->getAlpnSelectedProtocol()[B (greylist-max-q,core-platform-api,reflection, denied) W/utter.firebase(27206) ): 訪問隱藏方法 Lcom/android/org/conscrypt/AbstractConscryptSocket;->getAlpnSelectedProtocol()[B (greylist-max-q,reflection, denied) E/AndroidRuntime(27206): FATAL EXCEPTION: grpc-okhttp-0 E/ AndroidRuntime(27206):行程:com.learnflutter.firebasee,PID:27206 E/AndroidRuntime(27206):java.lang。運行(OkHttpClientTransport.java:571)E/AndroidRuntime(27206):在io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)E/AndroidRuntime(27206):在java.util.concurrent.ThreadPoolExecutor.runWorker( ThreadPoolExecutor.java:1167) E/AndroidRuntime(27206): 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) E/AndroidRuntime(27206): 在 java.lang.Thread.run(Thread. java:923) I/Process (27206):發送信號。PID:27206 SIG:9 與設備的連接丟失。641) E/AndroidRuntime(27206):在 java.lang.Thread.run(Thread.java:923) I/Process (27206):發送信號。PID:27206 SIG:9 與設備的連接丟失。641) E/AndroidRuntime(27206):在 java.lang.Thread.run(Thread.java:923) I/Process (27206):發送信號。PID:27206 SIG:9 與設備的連接丟失。
以下是我的 pubspec yaml 和我的構建 gradle 檔案:
構建搖籃:
ef localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 30
sourceSets {
main.java.srcDirs = 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.learnflutter.firebasee"
minSdkVersion 16
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.google.firebase:firebase-analytics'
implementation platform('com.google.firebase:firebase-bom:28.4.2')
implementation 'com.google.android.gms:play-services-location:18.0.0'
}
Pubspec Yaml:
name: firebasee
description: A new Flutter project.
environment:
sdk: ">=2.12.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
#Firebase
firebase_core: ^1.7.0
firebase_auth: ^3.1.2
cloud_firestore: ^2.5.3
add_2_calendar: ^2.1.2
datetime_picker_formfield: ^2.0.0
flutter_launcher_icons: ^0.9.2
flutter_spinkit: ^5.1.0
pull_to_refresh: ^2.0.0
dev_dependencies:
flutter_test:
sdk: flutter
有人可以幫我嗎?我一直在谷歌搜索錯誤并嘗試不同的東西,但沒有解決問題://
uj5u.com熱心網友回復:
您需要在模擬器上下載 Google Play (CH Play) 或使用真實設備代替,因為您在應用中使用的服務需要 Google Play 來處理。
uj5u.com熱心網友回復:
發生此錯誤是由于您的模擬器不支持 google play 服務。如果您使用 android studio 模擬器,請確保您創建了一個支持 google play API 的模擬器。選擇模擬器時,請確保選擇支持 e Play 商店的設備并選擇支持 Google Play 服務 API 的系統映像
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/311566.html
