Closed wood1986 closed 1 month ago
I am unable repro this:
% ./gradlew assembleDebug
> Configure project :
[AsyncStorage] Using Next storage: false
> Configure project :app
WARNING: The option setting 'android.jetifier.ignorelist=hermes-android' is experimental.
> Task :react-native-async-storage_async-storage:processDebugManifest
> Task :app:processDebugMainManifest
> Task :react-native-async-storage_async-storage:compileDebugJavaWithJavac
BUILD SUCCESSFUL in 1m 26s
109 actionable tasks: 104 executed, 5 up-to-date
Have you tried using the latest version?
Hey @tido64 and @krizzu
If you just set AsyncStorage_useNextStorage=false, and yes you can build without any issue. Having this AsyncStorage_useNextStorage=false is not enough
Did you have the follow configuration in the app/build.gradle in the example? I need to have the follow config in order to consume kotlin file.
It seems that your version is too old and requires extra setup to add kotlin (it used to be like that, not anymore since RN ships with Kotlin plugin). I recommend upgrading or applying kotlin plugin in your app's build.gradle
At the very beginning, this change is placed in the my own react-native app. When I build, the compiler complains this library. You can see my repo branch, I have been putting this configuration in the app/build.gradle
your version is too old
If you mean this lib, then I have been using the latest main branch to configure in my repo branch
If you mean RN version, then as on my side, it is a enterprise app, lots of teams share the same codebase, I cannot update it directly.
Hey @tido64 and @krizzu
I have already put a fix #1127. I have already moved the file to a different location to exclude "next" code.
Currently, when you have AsyncStorage_useNextStorage=false
, the current build setting does not build kotlin file. That's why you wont see this issue
After enabling supporting kotlin file, all kotlin files inside next folder will get included
I mean to update both (lib and RN). If you cannot update RN, try getting latest lib. Digging out old documentation, here's the setup guide for next storage from version 1.16.0 that should work for you
Here is the limitation on my side
The documentation you mentioned is asking me to use next. But I do not need and am not allow to use next.
May I ask you if you really check out my repro branch to see the actual issue?
OK. my question why it build the file inside next folder when AsyncStorage_useNextStorage=false after supporting kotlin file in the consumer app
Currently, when you have AsyncStorage_useNextStorage=false, the current build setting does not build kotlin file. That's why you wont see this issue
That's intended - next
is not included in build with flag off
.
OK. my question why it build the file inside next folder when AsyncStorage_useNextStorage=false after supporting kotlin file in the consumer app
When u press "configure kotlin" in android studio, kotlin plugin that's currently applied conditionally (based on useNextStorage
flag) is now applied directly, so it automatically consumes next
storage.
And I am telling you the fact. This is what it behaves currently. I know what you are talking about conditional flag. But this is not what you have believed
Is it possible to clone my fork and checkout branch to see how I can get rid of the room error?
https://github.com/wood1986/async-storage. 'repo/build-error'
Is it possible to clone my fork and checkout branch to see how I can get rid of the room error?
https://github.com/wood1986/async-storage. 'repo/build-error'
Yes, remove this line here
I either don't understand what the issue is or there are some bits that you're missing from my explanation.
The kotlin plugin (org.jetbrains.kotlin.android
) is applied only when useNextStorage is true. Same goes for dependencies, such as Room or Coroutines.
In your repo, you have flag set to off
, while you explicitly apply Kotlin plugin. In that case, dependencies are not included, but Kotlin plugin is looking for source files in default locations, such as src/java
/src/kotlin
, hence it compiles it, but then reports the issue with missing dependencies.
I am sorry for the false alarm. When I configure to support kotlin, I change the build.gradle for all modules. It includes this library. I should configure to the single app module only not all modules
What happened?
When I try to configure the my react-native app to support koltin file, this library gives these errors
Then I try the example of this library and set AsyncStorage_useNextStorage=false, it also gives me the same errors
Version
1.15.19
What platforms are you seeing this issue on?
System Information
Steps to Reproduce