Flutter Could not resolve all files for configuration - android

I was working on a project and is was working fine left it for 6 weeks and tried to run it yesterday and it gave me this error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':flutter_plugin_android_lifecycle:extractDebugAnnotations'.
> Could not resolve all files for configuration ':flutter_plugin_android_lifecycle:detachedConfiguration2'.
> Could not find lint-checks-30.1.2.jar (com.android.tools.lint:lint-checks:30.1.2).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint-checks/30.1.2/lint-checks-30.1.2.jar
> Could not find lint-api-30.1.2.jar (com.android.tools.lint:lint-api:30.1.2).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint-api/30.1.2/lint-api-30.1.2.jar
> Could not find intellij-core-30.1.2.jar (com.android.tools.external.com-intellij:intellij-core:30.1.2).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/intellij-core/30.1.2/intellij-core-30.1.2.jar
> Could not find kotlin-compiler-30.1.2.jar (com.android.tools.external.com-intellij:kotlin-compiler:30.1.2).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/kotlin-compiler/30.1.2/kotlin-compiler-30.1.2.jar
> Could not find uast-30.1.2.jar (com.android.tools.external.org-jetbrains:uast:30.1.2).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/external/org-jetbrains/uast/30.1.2/uast-30.1.2.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 32s
Exception: Gradle task assembleDebug failed with exit code 1
I tried deleting gradle and .gradle folder, also tried using VPN and changed my DNS also tried flutter clean command but non of the above worked.
note1: tried running the project as a windows app and it worked fine so I think its android build related problem.
note2: tried creating a new project and it worked fine.
note3: I have the latest version of flutter and dart.

The problem was solved
by running flutter clean in the project directory
and delete .gradle folder in C:/Users/DESKTOP-NAME/
and finally, flutter run.

Related

when i implement third party library in android studio ,android studio show error?

FAILURE: Build completed with 8 failures.
1: Task failed with an exception.
What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not find androidmads.library.qrgenerator:QRGenerator:1.0.3.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/androidmads/library/qrgenerator/QRGenerator/1.0.3/QRGenerator-1.0.3.pom
- https://repo.maven.apache.org/maven2/androidmads/library/qrgenerator/QRGenerator/1.0.3/QRGenerator-1.0.3.pom
- https://jcenter.bintray.com/androidmads/library/qrgenerator/QRGenerator/1.0.3/QRGenerator-1.0.3.pom
Required by:
project :app
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.
==============================================================================
Make sure you have a healthy internet connection.
Go to File menu and click invalidate Cache.
Re-open your project and run flutter clean command in the terminal from the root of your project.
Then run flutter pub get
If it still doesn't solve your problem, then keep following or commenting on this issue on github.

Android Emulator: Could not resolve all artifacts for configuration ':classpath'

When I select a Web chrome device and run flutter application it works, but when I select Android device and run flutter the build fails
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not find apksig-4.1.0.jar (com.android.tools.build:apksig:4.1.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/apksig/4.1.0/apksig-4.1.0.jar
> Could not find annotations-27.1.0.jar (com.android.tools:annotations:27.1.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/annotations/27.1.0/annotations-27.1.0.jar
> Could not find databinding-common-4.1.0.jar (androidx.databinding:databinding-common:4.1.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/databinding/databinding-common/4.1.0/databinding-common-4.1.0.jar
> Could not find baseLibrary-4.1.0.jar (com.android.databinding:baseLibrary:4.1.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/databinding/baseLibrary/4.1.0/baseLibrary-4.1.0.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 1s
Exception: Gradle task assembleDebug failed with exit code 1
Go to ADB manager and Wipe the data of your emulator than run the emulator it works fine

A problem occurred configuring root project 'android'. Unexpected lock protocol found in lock file. Expected 3, found 0

I recently changed my flutter project folder into a new one which will be used for production but after recopying everything back into the the new one i keep gettting this error
Launching lib\main.dart on Samsung Galaxy S10 in debug mode...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not create service of type OutputFilesRepository using ExecutionGradleServices.createOutputFilesRepository().
> Unexpected lock protocol found in lock file. Expected 3, found 0.
* 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 2m 24s
Exception: Gradle task assembleDebug failed with exit code 1
I have followed other way to to resolve eg like what someone said here in stack-overflow. i have also deleted the gradle from cache restarted my app still showing this error
Some of the build.gradle files can be found here github. Please how do i fix this, Thanks. Also if you need more explanation or code tell me
A useful answer from this post Error:Unexpected lock protocol found in lock file. Expected 3, found 0
cd path/to/.gradle/
find . -name "*.lock" -delete

Flutter path_provider Error - Could not resolve project :path_provider_linux

I have implemented various methods but errors appear every time I run android.
If you delete the path_provier_macos folder, a linux error appears.
You are currently using path_provier: ^1.6.11. Lowering the path_provier version is the same.
Please tell me the solution.
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':path_provider:compileDebugAidl'.
> Could not resolve all task dependencies for configuration
':path_provider:debugCompileClasspath'.
> Could not resolve project :path_provider_macos.
Required by:
project :path_provider
> Unable to find a matching configuration of project :path_provider_macos:
- None of the consumable configurations have attributes.
> Could not resolve project :path_provider_linux.
Required by:
project :path_provider
> Unable to find a matching configuration of project :path_provider_linux:
- None of the consumable configurations have attributes.
* 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 12s
Finished with error: Gradle task assembleDebug failed with exit code 1
Go to your Flutter sdk folder.
Go to [.pub-cache\hosted\pub.dartlang.org\ or .pub-cache\hosted\pub.flutter-io.cn\ ]
Remove all path_provider folders.
Pub get
Run your app.
I hope this fix your problem!

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.

Categories

Resources