The shared-storage artifact (org.asyncstorage.shared_storage:storage-android)
is not published to Maven Central, so Android builds fail unless the consumer
manually adds the local_repo Maven URL to their root build.gradle.
Move this configuration into the library's own build.gradle so it works
automatically. This removes the manual Android setup step from installation.
- Add local_repo Maven URL to module repositories
- Add rootProject.allprojects hook for transitive resolution
- Remove manual Android setup instructions from README and migration guide
- Remove manual repo config from example project
Summary
shared-storagein the library's ownbuild.gradleProblem
The
org.asyncstorage.shared_storage:storage-android:1.0.0artifact is bundled inandroid/local_repo/but is not published to Maven Central or Google's Maven repository. This means every consumer must manually add the local Maven URL to their rootandroid/build.gradle:allprojects { repositories { maven { url = uri(project(":react-native-async-storage_async-storage").file("local_repo")) } } }This is easy to miss during installation and causes confusing Gradle build failures (
Could not find org.asyncstorage.shared_storage:storage-android:1.0.0).Fix
Add the local Maven repository configuration directly to the library's
packages/async-storage/android/build.gradle:maven { url("${project.projectDir}/local_repo") }— resolves the dependency for the module itselfmaven { url("${rootDir}/../node_modules/...") }— ensures transitive resolution across the entire Android buildThis makes it work out of the box — no manual setup required.
Changes
packages/async-storage/android/build.gradle— add local Maven repo configurationREADME.md— remove manual Android setup sectiondocs/migration-to-3.md— remove manual Android setup instructionsexamples/react-native/android/build.gradle— remove manual repo config (now inherited)Patch (for patch-package users)
Until this is released, you can use this patch with patch-package:
@react-native-async-storage+async-storage+3.0.1.patch