async-storage: incompatible with Gradle 8.0.
What happened?
I have an error on a new project when i run react-native run-android
> Task :react-native-async-storage_async-storage:generateDebugRFile FAILED Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Version
Latest
What platforms are you seeing this issue on?
- Android
- iOS
- macOS
- Windows
- web
System Information
All latest versions
Steps to Reproduce
Run npx react-native run-android after npm install @react-native-async-storage/async-storage
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 7
- Comments: 18 (2 by maintainers)
For all of you hitting Android build issues, please have a look at this issue first: https://github.com/facebook/react-native/issues/35210
If your issue is related to Gradle 8.0 deprecation warning, please provide more logs so we can figure out what it’s complaining about. If your build is failing because of this, you probably enabled treating warnings as errors. This really shouldn’t fail your build.
This worked for me and should work for everyone else too.
Something about the issue:
Thanks @tido64 for this important information
I am also getting the same issue. Last time I built this project, it was working fine. But today suddenly it gave this error.
I have tried:
But nothing seems to work
When I tried to build the project after removing the async storage package, It gave the same error with react-native-gesture-handler
Like this:
> Task :react-native-gesture-handler:generateDebugRFile FAILED Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
I don’t know this error is casued due to async storage or something else I hope this gets solved as soon as possible
I tried many solutions, none worked. Strangely after restarting my machine, the problem disappeared. I don’t know how this is possible…
@Kenjy62 and @SaraChicaD
I am also facing the same issue. Are there any updates on how to fix it?
As everyone has mentioned already, please refer to https://github.com/facebook/react-native/issues/35210 to failing builds, due to the recent publication of RN to Maven Central.
Please reopen if your issue is something else
@aditya-upadhye – thanks for sharing! still working on getting mine to work, i did get past the error for this library though!
i ended up cloning a new copy of the project and installing the new RN version and it worked.
As mentioned by @tido64 and @bipinyadav3175, I checked out this: https://github.com/facebook/react-native/issues/35210 The patch (fix) for the same was released and all you had to do was update your react-native to the versions specified. My project was using React Native v0.67.2. I decided to move on with v0.67.5 which had the patch. In my project folder, I updated the same in my
package.json
andpackage-lock.json
files. Then I deleted node modules and by opening terminal in the project directory, I typednpm install
and hence the updated version of React Native was installed.Finally, using
npx react-native run-android
worked for me.@Kenjy62 @SaraChicaD @tido64 @bipinyadav3175 Thanking all you people. Because of your active replies and updates, I am now able to run my app without any errors.