Could not resolve datastore-preferences:1.0.0 in :app:checkDebugAarMetadata
I'm facing an issue while building my Flutter project for Android. The build fails with the following error message:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Failed to transform datastore-preferences-1.0.0.aar (androidx.datastore:datastore-preferences:1.0.0) to match attributes {artifactType=android-aar-metadata, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Could not find datastore-preferences-1.0.0.aar (androidx.datastore:datastore-preferences:1.0.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/datastore/datastore-preferences/1.0.0/datastore-preferences-1.0.0.aar
> Failed to transform datastore-1.0.0.aar (androidx.datastore:datastore:1.0.0) to match attributes {artifactType=android-aar-metadata, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Could not find datastore-1.0.0.aar (androidx.datastore:datastore:1.0.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/datastore/datastore/1.0.0/datastore-1.0.0.aar
Added DataStore dependencies in app/build.gradle:
dependencies {
implementation "androidx.datastore:datastore-preferences:1.0.0"
implementation "androidx.datastore:datastore:1.0.0"
}
Could the problem be from the shared_preferences library?
Why am I facing this issue, and how can I resolve it? Is there an issue with the Maven repository or the library version?
Source: View source