react-native-async-storage/async-storage

Android part of library contains StorageSupplier class in main source set which dependent on room

ardmn opened this issue · 4 comments

What happened?

My application have no room dependencies and I try to use useNextStorage = false but I get compilation error like Unresolved reference: room for StorageSupplier class. As I see StorageSupplier is located in main source set . But in build script u have room dependencies under the flaguseNextStorage i.e.:

if (useNextStorage) {
        def room_version = project.ext.AsyncStorageConfig.roomVersion

        implementation "androidx.room:room-runtime:$room_version"
        implementation "androidx.room:room-ktx:$room_version"
        ksp "androidx.room:room-compiler:$room_version"
}

Could you please explain how I can use this library when useNextStorage = false ? Is it possible ?

Version

1.24.0

What platforms are you seeing this issue on?

  • Android
  • iOS
  • macOS
  • Windows
  • web

System Information

its ok

Steps to Reproduce

  1. create android app without room,
  2. set useNextStorage to false
  3. build app

This works out of the box with the flag either on or off. Have tried with clean install of node modules?

Looks my bad . Problem was in custom gradle script which apply koltin.android plugin for all RN dependencies.

@krizzu Is there a way to detect whether the Kotlin plugin is being applied and let people know that it will force enable next storage?

@tido64

Is there a way to detect whether the Kotlin plugin is being applied

pluginManager.hasPlugin('kotlin-android') or project.pluginManager.hasPlugin('kotlin-android')