Android build failing
josmithua opened this issue · 5 comments
Hi there,
Thanks so much for this monorepo/tutorial!
I'm having issues with building the android app. When I hit the run button in Android Studio, the build fails with this message:
/Users/joshua/se/UserServices/UserRNApp/node_modules/@react-native-community/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageModule.java:26: error: package com.facebook.react.module.annotations does not exist
import com.facebook.react.module.annotations.ReactModule;
^
/Users/joshua/se/UserServices/UserRNApp/node_modules/@react-native-community/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageModule.java:34: error: cannot find symbol
@ReactModule(name = AsyncStorageModule.NAME)
^
symbol: class ReactModule
It's probably something to do with my configuration, but I can't seem to find the issue. Any pointers would be appreciated!
I'm using react-native 0.62.2 on a Mac.
Thanks!
I don’t think the issue is related to this repo, have you checked the issues from @react-native-community/async-storage?
The android build started failing after I converted it using your tutorial. Before it built fine, and it builds/runs fine on iOS. So I was wondering if you have seen this issue before when converting an app to use the monorepo structure.
If I remove @react-native-community/async-storage
, the problem occurs with the next dependency in my package.json
(which happens to be @react-native-community/datetimepicker
), so I think something wasn't configured right when I switched to the monorepo
Yep, I had forgotten to change the node modules paths in android/build.gradle
It'd be nice if your tutorial mentioned where all you need to change the paths. Otherwise it's impossible to just follow the tutorial, one needs to look through the code as well.
Otherwise excellent tutorial, thanks for taking the time to write it :)