Flutter无法下载kotlin编译器嵌入式1.5.21.jar文件(网址:jetbrains

d7v8vwbk  于 2023-03-03  发布在  Kotlin
关注(0)|答案(2)|浏览(640)

我正在创建一个Flutter应用程序。
现在我想添加Flutter OSM到项目中来使用Map。但是在添加flutter_osm_plugin到pubspec.yaml后,我得到了一个错误:

[!] Gradle threw an error while downloading artifacts from the network. Retrying to download...

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':flutter_osm_plugin'.
> Could not resolve all artifacts for configuration ':flutter_osm_plugin:classpath'.
   > Could not download kotlin-compiler-embeddable-1.5.21.jar (org.jetbrains.kotlin:kotlin-compiler-embeddable:1.5.21)
      > Could not get resource 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-compiler-embeddable/1.5.21/kotlin-compiler-embeddable-1.5.21.jar'.
         > Could not GET 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-compiler-embeddable/1.5.21/kotlin-compiler-embeddable-1.5.21.jar'.
            > Connect to fodev.org:8118 [fodev.org/45.129.39.130] failed: Connection refused: connect
> Failed to notify project evaluation listener.
   > Could not find method implementation() for arguments [project ':flutter_plugin_android_lifecycle'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
   > Could not find method implementation() for arguments [project ':location'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

* 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.

* Get more help at https://help.gradle.org

BUILD FAILED in 19s
Running Gradle task 'assembleDebug'...                             23,6s
[!] Gradle threw an error while downloading artifacts from the network. Retrying to download...
Exception: Gradle task assembleDebug failed with exit code 1

kotlin-compiler-embeddable-1.5.21.jar从浏览器下载。但我无法从Android Studio安装。我没有防病毒软件。

怎么了?多谢。

06odsfpq

06odsfpq1#

听起来你可能是在使用Android Studio构建Flutter应用(与VSCode或Flutter CLI相比)。请尝试此主题中的建议:Could not download kotlin-compiler-embeddable.jar

  • 确保您未处于脱机模式:
  • 点击文件〉设置(在Mac上,请点击Android Studio〉首选项)打开首选项窗口。
  • 在左侧窗格中,单击构建、执行、部署〉Gradle。
  • 单击应用或确定。
  • 更新库版本:
  • 点击依赖项〉查找并点击org. jetbrains. kotlin:kotlin-stdlib-jdk7:1.3.21(或您当前的版本)
  • 在"详细信息"〉"更新节"下,单击[更新变量]〉[更新依赖项]

请确认您的构建环境(A/S?);请让我们知道你是否解决了这个问题。

af7jpaap

af7jpaap2#

多谢了,我已经解决了这个问题。
我更改了一个Kotlin编译器版本,并在HTTP设置中选择了“无代理”。

相关问题