【问题标题】:Could not resolve all artifacts for configuration ':flutter_local_notifications:classpath'无法解析配置 ':flutter_local_notifications:classpath' 的所有工件
【发布时间】:2020-09-03 17:44:34
【问题描述】:

我在我的项目中使用了 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.

这里是颤振医生:


[√] 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)

谁能帮我解决这个问题! 我不知道如何解决它,我的项目也需要它! 我卡在里面了!!!

【问题讨论】:

    标签: android maven flutter gradle


    【解决方案1】:

    我终于通过将 gradle 升级到最新版本来修复它。 只需按照以下说明进行操作:https://gradle.org/install/ 使用 Gradle Wrapper 进行部分升级。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-06-04
      • 2023-03-17
      • 2020-01-31
      • 2020-11-08
      • 2022-09-29
      • 2021-07-28
      • 1970-01-01
      • 2022-07-09
      相关资源
      最近更新 更多