gpt4 book ai didi

android - Flutter -Firebase/FireStore - 无法到达 Cloud Firestore 后端。后端在 10 秒内没有响应

转载 作者:行者123 更新时间:2023-12-02 18:04:43 25 4
gpt4 key购买 nike

我目前正在 VSCode 中开发一个 Flutter 项目,使用 firestore 作为我的数据库。我已经在这个项目上工作了好几个月,并且以任何方式连接到 firestore 都没有遇到任何问题。最近我得到了新的硬盘驱动器并传输了所有文件,并且一切都正确编译。我已经更新了所有依赖项,Flutter Doctor 没有任何问题,并且我在以前的帖子中搜索了几个小时,尝试了几乎所有解决方案,但都没有奏效。

在工作和不工作之间,我没有更改我的任何代码。我已经更改了许多设置和配置文件,试图让它现在工作。

两个重要提示

  1. 我正在通过 Android Studio 试用模拟器。我试过 3 种不同的模拟器。
    • 1 安装了 google play 服务
    • 1 没有安装 google play 服务
    • 1 没有安装 google play 服务,是我手动添加的

他们都有同样的问题。

  1. 我在许多当前成功访问数据库的设备上运行旧版本。

我收到错误

W/DynamiteModule( 6511): Local module descriptor class for com.google.android.gms.providerinstaller.dynamite not found.
I/DynamiteModule( 6511): Considering local module com.google.android.gms.providerinstaller.dynamite:0 and remote module com.google.android.gms.providerinstaller.dynamite:0
W/ProviderInstaller( 6511): Failed to load providerinstaller module: No acceptable module com.google.android.gms.providerinstaller.dynamite found. Local version is 0 and remote version is 0.
W/ProviderInstaller( 6511): Failed to report request stats: com.google.android.gms.common.security.ProviderInstallerImpl.reportRequestStats [class android.content.Context, long, long]
W/Firestore( 6511): (24.2.2) [OnlineStateTracker]: Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds
W/Firestore( 6511):
W/Firestore( 6511): This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.
W/DynamiteModule( 6511): Local module descriptor class for com.google.android.gms.providerinstaller.dynamite not found.
W/Firestore( 6511): (24.2.2) [WatchStream]: (4aed552) Stream closed with status: Status{code=UNAVAILABLE, description=Channel shutdownNow invoked, cause=null}.
I/DynamiteModule( 6511): Considering local module com.google.android.gms.providerinstaller.dynamite:0 and remote module com.google.android.gms.providerinstaller.dynamite:0
W/ProviderInstaller( 6511): Failed to load providerinstaller module: No acceptable module com.google.android.gms.providerinstaller.dynamite found. Local version is 0 and remote version is 0.
W/ProviderInstaller( 6511): Failed to report request stats: com.google.android.gms.common.security.ProviderInstallerImpl.reportRequestStats [class android.content.Context, long, long]

我从其他论坛帖子中尝试过的步骤:

  1. 放入所有 3 个 AndroidManifest.xml 文件
  2. 在main下放入AndroidManifest.xml
  3. 启用 Multidex
  4. 使用了不同的 wifi 连接
  5. 第二天再次查看同样的问题
  6. 我的最低 SDK 版本是 21
  7. 所有模拟器都有 wifi 连接。 (我通过网上搜索测试过)
  8. 其他不记得了

flutter 医生:

[√] Flutter (Channel stable, 3.3.0, on Microsoft Windows [Version 10.0.19044.1889], locale en-US)
• Flutter version 3.3.0 on channel stable at D:\Coding\Flutter\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision ffccd96b62 (2 days ago), 2022-08-29 17:28:57 -0700
• Engine revision 5e9e0e0aa8
• Dart version 2.18.0
• DevTools version 2.15.0

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at C:\Users\mjdk9\AppData\Local\Android\sdk
• Platform android-33, build-tools 33.0.0
• Java binary at: D:\Applications\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
• All Android licenses accepted.

[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.3.3)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.3.32825.248
• Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2021.2)
• Android Studio at D:\Applications\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)

[√] Connected device (4 available)
• sdk gphone x86 (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19044.1889]
• Chrome (web) • chrome • web-javascript • Google Chrome 104.0.5112.102
• Edge (web) • edge • web-javascript • Microsoft Edge 104.0.1293.70

[√] HTTP Host Availability
• All required HTTP hosts are available

• No issues found!

pubspec.yaml 依赖项

dependencies:
flutter:
sdk: flutter


# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
firebase_core: ^1.4.0
firebase_auth: ^3.0.1
cloud_firestore: ^3.4.6
firebase_analytics: ^9.3.3
material_floating_search_bar: ^0.3.4
provider: ^6.0.3
flutter_launcher_icons: ^0.10.0
url_launcher: ^6.0.10
url_launcher_web: ^2.0.4
flutter_rating_bar: ^4.0.0
smooth_star_rating: ^1.1.1
dropdown_button2: ^1.0.7
confetti: ^0.7.0
flutter_native_splash: ^2.1.6
http: ^0.13.4
get: ^4.6.1
audioplayers: ^1.0.1
loader_overlay: ^2.0.6
webview_flutter: ^3.0.2
syncfusion_flutter_datagrid: ^20.1.61
cloud_functions: ^3.2.17

app/build.gradle

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'

defaultConfig {
multiDexEnabled true
applicationId "com.mjdk99.matter_medical_supplies"
minSdkVersion 21
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation platform('com.google.firebase:firebase-bom:30.3.2')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.android.gms:play-services-location:18.0.0'
}

build.gradle

buildscript {
ext.kotlin_version = '1.6.10'
repositories {
google()
mavenCentral()
jcenter()
}

dependencies {
classpath 'com.google.gms:google-services:4.3.13'
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
mavenCentral()
jcenter()
}
}

最佳答案

现在我也遇到了这个问题,安卓模拟器没有连接到我的 firebase,但我的物理设备没有问题。但是,我可以使用同一个项目,但使用 Firebase 模拟器套件而不是我的数据库。

可能无法解决您的问题,但至少在您解决问题之前它是一种解决方法。

关于android - Flutter -Firebase/FireStore - 无法到达 Cloud Firestore 后端。后端在 10 秒内没有响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73559563/

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