简体   繁体   中英

Could not resolve all artifacts for configuration ':flutter_local_notifications:classpath'

i iam using flutter_local_notifications in my project, i added it to pubspec.yaml and press the pub get. but after launching the app i faced error below:


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

and here is flutter doctor:


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

can anyone help me with this please! i dont know how to solve it and i also need it for my project! i stuck in it!!!

i finally fixed it by upgrading gradle to the latest version. just follow the instructions in: https://gradle.org/install/ in part Upgrade with the Gradle Wrapper.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM