Issue in building the android apk with react native firebase 5.4.3
Issue
I am trying to build the android project with react-native-firebase version 5.4.3 Getting the below issues: FAILURE: Build failed with an exception.
-
Where: Build file '/Users/vivek/Desktop/Goibibo/goibibo_mobile/afore/node_modules/react-native-firebase/android/build.gradle' line: 130
-
What went wrong: A problem occurred evaluating project ':react-native-firebase'.
react-native-firebase: unable to locate React Native android sources or prebuilt binary. Ensure you have you installed React Native as a dependency in your project and try again.
-
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
-
Get more help at https://help.gradle.org
CONFIGURE FAILED in 2s react-native-firebase: unable to locate React Native android sources or prebuilt binary. Ensure you have you installed React Native as a dependency in your project and try again. Open File
android/settings.gradle:
include ':react-native-firebase' project(':react-native-firebase').projectDir = new File(rootProject.projectDir, './afore/node_modules/react-native-firebase/android')
Environment
React Native Environment Info: System: OS: macOS High Sierra 10.13.1 CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz Memory: 120.14 MB / 16.00 GB Shell: 5.3 - /bin/zsh Binaries: Node: 11.3.0 - ~/.nvm/versions/node/v11.3.0/bin/node npm: 6.4.1 - ~/.nvm/versions/node/v11.3.0/bin/npm Watchman: 4.7.0 - /usr/local/bin/watchman SDKs: Android SDK: API Levels: 14, 19, 22, 23, 24, 25, 26, 27, 28 Build Tools: 19.1.0, 20.0.0, 21.1.2, 22.0.1, 23.0.1, 23.0.2, 23.0.3, 24.0.0, 24.0.1, 24.0.2, 24.0.3, 25.0.0, 25.0.1, 25.0.2, 25.0.3, 26.0.0, 26.0.1, 26.0.2, 27.0.3, 28.0.2, 28.0.3 System Images: android-19 | ARM EABI v7a, android-19 | Intel x86 Atom, android-22 | Google APIs ARM EABI v7a, android-22 | Google APIs Intel x86 Atom, android-24 | Google APIs Intel x86 Atom, android-24 | Google Play Intel x86 Atom, android-28 | Google Play Intel x86 Atom IDEs: Android Studio: 3.1 AI-173.4720617 Xcode: /undefined - /usr/bin/xcodebuild npmPackages: react: 16.6.1 => 16.6.1 react-native: 0.59.9
react-native-firebase build.gradle expects prebuild into this: /Users/vivek/Desktop/abc/node_modules/react-native/android
but mine is in: /Users/vivek/Desktop/abc/def/ghi/node_modules/react-native/android
@Salakar this looks like some react-native-firebase build-time / CLI assumption?
@vivek-walecha-657 you have not followed the template. You need to post your gradle files at minimum for this I think?
I think the project folder structure here is weird, could you show us your directory structure, is this some kind of mono repo or something?
@Salakar react native project of our's is the submodule of our native Android project. Which eventually drops the react-native lib to two directories down in the directory tree, due to which react native firebase build.gradle is not able to locate the react-native lib, that's why it is failing. But in 5.0.0 it was working fine with the same directory structure.
RNF v5.4.3: `// Running React Native from sources locally or for ExpoKit def androidSourcesDir = new File( parentDir, 'node_modules/react-native' )
// Official releases of React Native come with a prebuilt version of Android sources
// in ./android, e.g. react-native/android/**/react-native-0.57.1.aar
def androidPrebuiltBinaryDir = new File(
parentDir,
'node_modules/react-native/android'
)`
Actual location of react native lib /Users/vivek/Desktop/Goibibo/goibibo_mobile/afore/node_modules/react-native Expected location by RNF /Users/vivek/Desktop/Goibibo/node_modules/react-native
Hello 👋, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?
This issue will be closed in 15 days if no further activity occurs. Thank you for your contributions.
Closing this issue after a prolonged period of inactivity. If this is still present in the latest release, please feel free to create a new issue with up-to-date information.
@jhonex11 reported for spam
cd android
./gradlew clean
worked for me