使用位置依赖项时的flutter、kotlin gradle 问题

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

在此处输入图像描述* 出了什么问题: 任务“:location:compileDebugKotlin”执行失败。

执行 org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction 时发生故障 编译错误。查看日志了解更多详情

  • 尝试:

使用 --stacktrace 选项运行以获取堆栈跟踪。 使用 --info 或 --debug 选项运行以获得更多日志输出。 使用 --scan 运行以获得完整的见解。

1m 8s 内构建失败

┌─ 抖动修复 ────────────────────────────────────────────── ──────────────────────────────────┐ │ [!] 您的项目需要更新版本的 Kotlin Gradle 插件。 │ │ 在 https://kotlinlang.org/docs/releases.html#release-details 上找到最新版本,然后 │ │ 更新 /Users/a/Downloads/untitled/android/build.gradle: │ │ ext.kotlin_version = '' │ └────────────────────────────────────────────────── ────────────────────────────────────────────┘ 错误:Gradle 任务 assembleDebug 失败,退出代码为 1

flutter location
1个回答
0
投票

我只使用Android Studio解决了这个问题,否则我无法解决它,这是通过在Android/build.gradle文件中添加以下内容:

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

    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

在 Android Studio 中,您会看到类似“在 Android Studio 中打开以进行编辑”的内容,只需打开它,它将开始下载和编译。

我希望它对你有用。

© www.soinside.com 2019 - 2024. All rights reserved.