Task :@react-native-community_async-storage:generateDebugRFile
Changing the value for a property with a final value has been deprecated. This will fail with an error in Gradle 6.0.
Task :@react-native-community_async-storage:compileDebugJavaWithJavac FAILED
/Users/suraneti/cm-transit-app/node_modules/@react-native-community/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorag
e/AsyncStorageModule.java:26: error: package com.facebook.react.module.annotations does not exist
import com.facebook.react.module.annotations.ReactModule;
^
/Users/suraneti/cm-transit-app/node_modules/@react-native-community/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorag
e/AsyncStorageModule.java:33: error: cannot find symbol
@ReactModule(name = AsyncStorageModule.NAME)
^
symbol: class ReactModule
2 errors
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ':@react-native-community_async-storage:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
Run successful
npm install
react-native run-android
Hi @suraneti,
Gradle 6.0 info is a warning. The real issue is reactnativecommunity/asyncstorag
e/AsyncStorageModule.java:26: error: package com.facebook.react.module.annotations does not exist
Seems like your RN dependencies are not synced/added correctly. Try cleaning up your project/removing node_modules and install everything again.
@Krizzu after I've cleaned up gradle and re-install node_modules, problem seem to be solved now.
Im having this issue currently, cleaned gradel and reinstalled node_modules, any tips?
@MUllman here my RN info and library version, I still don't know what is root of this problem.
Async Storage version: 1.4.2
React Native Environment Info:
System:
OS: macOS 10.14.5
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Memory: 8.21 GB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.15.0 - /usr/local/bin/node
Yarn: 1.13.0 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
Android SDK:
API Levels: 23, 24, 25, 26, 27, 28
Build Tools: 26.0.1, 26.0.2, 27.0.3, 28.0.2, 28.0.3
System Images: android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom_64
IDEs:
Android Studio: 3.3 AI-182.5107.16.33.5199772
Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.3 => 16.8.3
react-native: 0.59.9 => 0.59.9
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7
react-native-rename: 2.4.1
Check your app/build.gradle dependencies (if it has indeed RN dep), clean gradle and yarn caches, remove node_modules resync everything.
If you're working in android, remove .idea/modules and restart it.
Worked for me after I had been trying to debug the problem for several hours.
Further, try to also incorporate the step provided as a solution in this similar stackoverflow issue
Solution doesn't work on my app @Krizzu
Tried:
Issue still appears
AsyncStorageModule: error: package com.facebook.react.module.annotations does not exist
@wkwyatt maybe your RN < 0.60 and some library required RN >= 0.60
can you provide your package.json?
I think I had slightly different issue, but the error above was there too and what helped me was this
./gradlew clean
rm -rf ~/.gradle/caches/*
./gradlew clean is OKAY

After removing .gradle folder and build folder inside android folder of react native project, everything is work for me.
After removing .gradle folder and build folder inside android folder of react native project, everything is work for me.
It is ok for me!!
Most helpful comment
I think I had slightly different issue, but the error above was there too and what helped me was this