我正在創建一個 Flutter 應用程式。
現在我想將 Flutter OSM 添加到專案中以使用地圖。但是在將 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 安裝它。我沒有防病毒軟體。
什么問題?非常感謝。
uj5u.com熱心網友回復:
聽起來您可能正在使用 Android Studio(與 VSCode 或 Flutter CLI)構建您的 Flutter 應用程式。請嘗試此執行緒中的建議:無法下載 kotlin-compiler-embeddable.jar
確保您未處于離線模式:
通過單擊檔案 > 設定(在 Mac 上,Android Studio > 首選項)打開首選項視窗。
在左側窗格中,單擊構建、執行、部署 > Gradle。選中離線作業復選框。
單擊應用或確定。
更新庫版本:
- 單擊 Dependencies > Find 并單擊 org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.21 (或任何您當前的版本)
- 在詳細資訊 > 更新部分下,單擊 [更新變數] > [更新依賴項]
請確認您的構建環境(A/S?);如果您解決了問題,請告訴我們。
uj5u.com熱心網友回復:
非常感謝。我已經解決了這個問題。
我更改了 kotlin 編譯器版本并在 HTTP 設定中選擇了“無代理”。
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/408435.html
標籤:
