Could not find androidx.legacy:legacy-support-v4:27.0.2 - android

I added geolocator dependency and then I get an error of android x incompatibility. can any help me to get out of this?
Launching lib\main.dart on Android SDK built for x86 in debug mode...
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:preDebugBuild'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
> Could not find androidx.legacy:legacy-support-v4:27.0.2.
Searched in the following locations:
- file:/C:/Users/Rutvik/AppData/Local/Android/sdk/extras/m2repository/androidx/legacy/legacy-support-v4/27.0.2/legacy-support-v4-27.0.2.pom
Required by:
project :app > project :image_picker
* 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 1m 7s
****************************************************

Migrating all the dependancies to andriodx packages will resolve this issue. https://developer.android.com/jetpack/androidx/migrate
Here your geo-locator latest uses androidx packages where image_picker dependency uses android package. You need to update image_picker library to latest https://pub.dev/packages/image_picker#-changelog-tab-
or
Quick fix: Downgrade geo-locator to 2.1.1 to resolve this issue. This is not a best approach.
Upgrading all the dependancies to androidx compatable is best approach you can try.

Related

Gradle Issue in Android Studio

Extracted the android package from ionic project, opened it in Android Studio,
Distribution URL : https\://services.gradle.org/distributions/gradle-7.4-all.zip
Inside Project level build.gradle : classpath 'com.android.tools.build:gradle:7.4'
Inside cash.properties : gradle.version=7.4
Getting below error in Android Studio :
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 com.android.tools.build:gradle:7.4.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.4/gradle-7.4.pom
- https://jcenter.bintray.com/com/android/tools/build/gradle/7.4/gradle-7.4.pom
Required by:
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 746ms
What might be the Issue ?
From what i've seen here, version 7.4 is not yet available on Google maven repositories.
You could try targeting a lower version (like 7.3.0-alpha05, or 7.1.2 if you need stable release), and don't forget to set the same version to your distributionUrl.

could not resolve all dependencies for configuration ':classpath' on flutter

hi recently I upgrade and flutter to v2 and my android studio too but after that my flutter app gives a Gradle error and cant be extracted I tried too hard to do many solutions like but maven in dependency but it still gives an error.the gradle version is now 5.6 or something and one more thing all the application running well still which i made before upgrade and its gradle version is
Please help me out and the error is given below.
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 load module metadata from C:\Users\dell.gradle\caches\modules-2\metadata-2.96\descriptors\com.android.tools\annotations\27.1.0\11cd36a7dcab7d14d0c14c5e6c7582e3\descriptor.bin
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 20s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

Flutter Android resource linking failed and Failed to apply plugin [id 'kotlin-android']

Opened a project after 2 months, got null-safety error changed some plugins, and upgraded others, one thing led to another and now I am stuck at this error!
Tried Flutter clean and deleting the build and .gradle folder but nothing worked.
Launching lib\main.dart on RMX1801 in debug mode...
lib\main.dart:1
3
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
C:\Users\Dell\.gradle\caches\transforms-2\files-2.1\b94a6b46912fba96397655c3d1ce5de0\play-services-ads-lite-19.6.0\AndroidManifest.xml:27:5-38:15: AAPT: error: unexpected element <queries> found in <manifest>.
* 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 8m 59s
The build failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetifier to solve the incompatibility.
Building plugin audioplayers...
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\Dell\flutter\.pub-cache\hosted\pub.dartlang.org\audioplayers-0.18.2\android\build.gradle' line: 25
* What went wrong:
A problem occurred evaluating root project 'audioplayers'.
> Failed to apply plugin [id 'kotlin-android']
> The current Gradle version 4.10.2 is not compatible with the Kotlin Gradle plugin. Please use Gradle 5.3 or newer, or the previous version of the Kotlin plugin.
* 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 54s
2
Exception: The plugin audioplayers could not be built due to the issue above.
Exited (sigterm)
You're getting a AAPT: error: unexpected element <queries> found in <manifest>. it looks like you have to update your gradle version to one of the ones listed here
https://github.com/miguelpruivo/flutter_file_picker/wiki/Troubleshooting
3.3.3
3.4.3
3.5.4
3.6.4
4.0.1
it looks like you need to downgrade your gradle version since you're using 4.10.2

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!

Gradle upgrade to version 6.2.1 issues

I'm having problems upgrading my Gradle to version 6.2.1 I'm currently running android studio 3.6.1 I'm trying to do this because I kept getting an error that says Minimum supported Gradle version is 5.6.4. Current version is 4.10.2.
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 com.android.tools.build:gradle:6.2.1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/6.2.1/gradle-6.2.1.pom
- https://jcenter.bintray.com/com/android/tools/build/gradle/6.2.1/gradle-6.2.1.pom
Required by:
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 5s
Finished with error: Gradle task assembleDebug failed with exit code 1

Categories

Resources