簡體   English   中英

無法解析配置 ':flutter_local_notifications:classpath' 的所有工件

[英]Could not resolve all artifacts for configuration ':flutter_local_notifications:classpath'

我在我的項目中使用flutter_local_notifications,我將它添加到pubspec.yaml 並按pub get。 但啟動應用程序后,我遇到以下錯誤:


* What went wrong:
A problem occurred configuring project ':flutter_local_notifications'.
> Could not resolve all artifacts for configuration ':flutter_local_notifications:classpath'.
   > Could not find gradle.jar (com.android.tools.build:gradle:3.5.3).
     Searched in the following locations:
         https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.3/gradle-3.5.3.jar
   > Could not find builder.jar (com.android.tools.build:builder:3.5.3).
     Searched in the following locations:
         https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/3.5.3/builder-3.5.3.jar
   > Could not find crash.jar (com.android.tools.analytics-library:crash:26.5.3).
     Searched in the following locations:
         https://dl.google.com/dl/android/maven2/com/android/tools/analytics-library/crash/26.5.3/crash-26.5.3.jar
   > Could not find lint-gradle-api.jar (com.android.tools.lint:lint-gradle-api:26.5.3).
     Searched in the following locations:
         https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint-gradle-api/26.5.3/lint-gradle-api-26.5.3.jar
   > Could not find gradle-api.jar (com.android.tools.build:gradle-api:3.5.3).
     Searched in the following locations:
         https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle-api/3.5.3/gradle-api-3.5.3.jar
> Could not get unknown property 'android' for project ':flutter_local_notifications' of type org.gradle.api.Project.

* 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 13s
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin flutter_local_notifications...
Running Gradle task 'assembleAarRelease'...

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'flutter_local_notifications'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not find gradle.jar (com.android.tools.build:gradle:3.5.3).
     Searched in the following locations:
         https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.3/gradle-3.5.3.jar
   > Could not find builder.jar (com.android.tools.build:builder:3.5.3).
     Searched in the following locations:
         https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/3.5.3/builder-3.5.3.jar
   > Could not find crash.jar (com.android.tools.analytics-library:crash:26.5.3).
     Searched in the following locations:
         https://dl.google.com/dl/android/maven2/com/android/tools/analytics-library/crash/26.5.3/crash-26.5.3.jar
   > Could not find lint-gradle-api.jar (com.android.tools.lint:lint-gradle-api:26.5.3).
     Searched in the following locations:
         https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint-gradle-api/26.5.3/lint-gradle-api-26.5.3.jar
   > Could not find gradle-api.jar (com.android.tools.build:gradle-api:3.5.3).
     Searched in the following locations:
         https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle-api/3.5.3/gradle-api-3.5.3.jar

* 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 3s

Exception: The plugin flutter_local_notifications could not be built due to the issue above.

這是 flutter 醫生:


[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[√] Android Studio (version 3.6)
[√] IntelliJ IDEA Community Edition (version 2019.3)
[√] Connected device (1 available)

任何人都可以幫我解決這個問題! 我不知道如何解決它,我的項目也需要它! 我卡在里面了!!!

我終於通過將 gradle 升級到最新版本來修復它。 只需按照以下說明進行操作: https://gradle.org/install/部分使用 Gradle Wrapper 進行升級。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM