安装 Firebase 依赖项后 Flutter 出现 Gradle 错误

问题描述 投票:0回答:0

因此,当我在 IOS 模拟器中运行代码时,它可以正常工作,但是当我尝试为 android 运行相同的代码时,它给了我 gradle 错误。我运行过如下命令:

flutter clean
flutter pub get
flutter run

这无法解决问题。我什至尝试更新我的 gradle 版本,但问题仍未解决。

我现在在项目中安装的依赖项:

cloud_firestore: ^4.5.0
cupertino_icons: ^1.0.2
firebase_analytics: ^10.2.0
firebase_auth: ^4.4.0
firebase_core: ^2.9.0

gradle-wrapper.properties:

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip

即将到来的错误:

Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
Exception in thread "main" java.util.zip.ZipException: zip END header not found
        at java.base/java.util.zip.ZipFile$Source.zerror(ZipFile.java:1607)
        at java.base/java.util.zip.ZipFile$Source.findEND(ZipFile.java:1497)
        at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1504)
        at java.base/java.util.zip.ZipFile$Source.<init>(ZipFile.java:1308)
        at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1271)
        at java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:733)
        at java.base/java.util.zip.ZipFile$CleanableResource.get(ZipFile.java:850)
        at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:248)
        at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:177)
        at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:191)
        at org.gradle.wrapper.Install.unzip(Install.java:214)
        at org.gradle.wrapper.Install.access$600(Install.java:27)
        at org.gradle.wrapper.Install$1.call(Install.java:74)
        at org.gradle.wrapper.Install$1.call(Install.java:48)
        at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
        at org.gradle.wrapper.Install.createDist(Install.java:48)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Running Gradle task 'assembleDebug'...                             380ms
Exception: Gradle task assembleDebug failed with exit code 1

我期待应用程序在安卓模拟器中打开

android flutter firebase dart gradle
相关问题

安装 sudo gem install cocoapods 时出错

因为chatview >=1.0.0 依赖intl ^0.18.0 和mobile_app 依赖intl ^0.17.0, chatview >=1.0.0 是禁止的

安装 easyocr 时安装构建依赖项的 pip 子进程未成功运行

异常:Gradle 任务 assembleDebug 失败,退出代码为 1。找不到 com.android.tools.build:gradle:8.1.0

安装kivy包有问题,退出代码:1

Como 安装依赖于 npx create-expo-app para criar o projeto 的 react-native-speedometer-chart utlizando [关闭]

我尝试在flutter-fire-base中创建项目时出现错误如何解决这个问题

ErrorDuplicate class kotlin.collections.jdk8.CollectionsJDK8Kt found in modules kotlin-stdlib-1.8.0

在 Android 环境上使用共享首选项版本 2.1.0 后出现 Flutter gradle 错误

异常:Gradle 任务 assembleDebug 失败,退出代码为 1 Flutter

Android Studio Gradle Build Error: Could not determine the dependencies of task ':app:compileFreeDebugJavaWithJavac'

Error:未为类“ActionCodeInfo”定义方法“FallThroughError”。 - 'ActionCodeInfo' 来自 'package:firebase_auth_

更新 flutter 和 xcode 后 Xcode 14.3 中缺少文件 (libarclite_iphoneos.a)

Android Studio 中“无法解析 Android 应用程序模块的 Gradle 配置”?错误

cocoapods 未安装或未使用 flutter 处于有效状态

无法安装 express-graphql

headless-gl 安装时出现构建错误

在我的 flutter 项目中安装 firebase 后我在运行应用程序时遇到问题问题是应用程序没有启动

我的 React-native android 应用程序在卸载后无法构建权限,现在它不会在 android 模拟器上安装应用程序

Flutter Doctor:运行“flutter doctor --android-licenses”时出错

热门问答
最新问题