【问题标题】:flutter.gradle' line: 1070flutter.gradle\' 行:1070
【发布时间】:2022-10-16 12:09:44
【问题描述】:

我无法运行我的构建

我有这个代码

你能帮我吗?

/C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_storage_platform_interface-4.1.0/lib/src/method_channel/utils/exception.dart:19:11: Error: Member not found: 'Error.throwWithStackTrace'.
    Error.throwWithStackTrace(exception, stackTrace);
          ^^^^^^^^^^^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_storage_platform_interface-4.1.0/lib/src/method_channel/utils/exception.dart:22:9: Error: Member not found: 'Error.throwWithStackTrace'.
  Error.throwWithStackTrace(
        ^^^^^^^^^^^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_storage_platform_interface-4.1.0/lib/src/method_channel/utils/exception.dart:14:7: Error: A non-null value must be returned since the return type 'Never' doesn't allow null.
Never convertPlatformException(
      ^


FAILURE: Build failed with an exception.

* Where:
Script 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1070

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

【问题讨论】:

标签: flutter android-studio dart


【解决方案1】:

首先检查颤振版本是 2.8.1 然后通过下面的代码更新并检查颤振版本是 3.3.4。

更新颤振: 使用命令:“颤振升级”

检查命令是更新是 3.3.4

那么如果您的应用程序可能会遇到这个问题
minSdkVersion flutter.minSdkVersion 如果在 flutter.gradle 文件中设置为 16 或吹 16 然后你去这个目录 C:lutterpackageslutter_toolsgradlelutter.gradle 并在注释enter image description herepade 中打开flutter.gradle。

将 static int minSdkVersion = 16 this 更改为

静态 int minSdkVersion = 19

[!] 您的项目需要更新版本的 Kotlin Gradle 插件。 │ │ 在https://kotlinlang.org/docs/gradle.html#plugin-and-versions 上找到最新版本,然后 │ │ 更新 D:RohitFLutter_LABexamplendroiduild.gradle: │ │ ext.kotlin_version = ''

并解决这个问题去 appuild.gradle :

默认配置 { // TODO: 指定您自己的唯一应用程序 ID (https://developer.android.com/studio/build/application-id.html)。 应用程序ID“com.example.example” minSdkVersion 颤动.minSdkVersion targetSdkVersion 颤动.targetSdkVersion

    **multiDexEnabled true**  //ADD THIS LINE
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
}

【讨论】:

    猜你喜欢
    • 2022-01-16
    • 1970-01-01
    • 2022-08-11
    • 2021-08-21
    • 2020-08-18
    • 2013-04-27
    • 2021-10-28
    • 2022-11-04
    • 2021-05-14
    相关资源
    最近更新 更多