Skip to content

bug: 文档中 Maven 镜像配置示例使用了 Groovy 语法,在 Kotlin DSL(.kts)下无法编译。 #294

Description

@TPAXcc

先决条件 (Prerequisites)

  • 我已确认这个问题没有在其他 issues中提出过。
    I am sure that this problem has NEVER been discussed in other issues.

发生了什么(What happened)

PS D:\Workspace\Project\intelligentFlows\chat_keystone\app> flutter run -d 192.168.1.8
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
Launching lib\main.dart on 24129RT7CC in debug mode...
e: file:///D:/Workspace/Project/intelligentFlows/chat_keystone/app/android/build.gradle.kts:5:21: Unexpected tokens (use ';' to separate expressions on the same line)

FAILURE: Build failed with an exception.

* Where:
Build file 'D:\Workspace\Project\intelligentFlows\chat_keystone\app\android\build.gradle.kts' line: 5

* What went wrong:
Script compilation error:

  Line 5:         maven { url 'https://mirrors.cernet.edu.cn/flutter/download.flutter.io' }
                              ^ Unexpected tokens (use ';' to separate expressions on the same line)

1 error

* 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 generate a Build Scan (Powered by Develocity).
> Get more help at https://help.gradle.org.

BUILD FAILED in 4s
Running Gradle task 'assembleDebug'...                              4.8s
Error: Gradle task assembleDebug failed with exit code 1

期望的现象(What you expected to happen)

PS D:\Workspace\Project\intelligentFlows\chat_keystone\app> flutter run -d 192.168.1.8
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
Launching lib\main.dart on 24129RT7CC in debug mode...
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
Running Gradle task 'assembleDebug'...                                 ⣷

如何重现此问题(How to reproduce it)

maven { url 'https://mirrors.cernet.edu.cn/flutter/download.flutter.io' }添加到flutter build.gradle.kts

操作系统(OS Version)

No response

浏览器(如果适用)(Browser version, if applicable)

No response

其他环境(Other environments)

No response

其他需要说明的事项(Anything else we need to know)

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions