I see compile failures in the main app module, related to the new GoogleApiAvailability work: #3601
I recognize these don't show up in the test app but I think that may be because the test app is out of date
The test app should at least be updated to use the new crashlytics, and I believe the google services plugin line needs to move up to top of the android/app/build.gradle
Here's the compile failure I see, for what it's worth:
/home/mike/work/Kullki/ksocialscore/packages/public-app/node_modules/@react-native-firebase/app/android/src/reactnative/java/io/invertase/firebase/utils/ReactNativeFirebaseUtilsModule.java:29: error: cannot find symbol
import com.google.android.gms.common.GoogleApiAvailability;
^
symbol: class GoogleApiAvailability
location: package com.google.android.gms.common
I'm currently solving it with this patch
cat patches/@react-native-firebase+app+8.2.0.patch
:
diff --git a/node_modules/@react-native-firebase/app/android/build.gradle b/node_modules/@react-native-firebase/app/android/build.gradle
index 097bfe3..5c277fd 100644
--- a/node_modules/@react-native-firebase/app/android/build.gradle
+++ b/node_modules/@react-native-firebase/app/android/build.gradle
@@ -42,6 +42,11 @@ project.ext {
])
}
+
+def safeExtGet(prop, fallback) {
+ rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
+}
+
android {
defaultConfig {
multiDexEnabled true
@@ -71,6 +76,8 @@ dependencies {
implementation platform("com.google.firebase:firebase-bom:${ReactNative.ext.getVersion("firebase", "bom")}")
implementation "com.google.firebase:firebase-core"
implementation "com.google.firebase:firebase-common"
+ def googlePlayServicesAuthVersion = safeExtGet('googlePlayServicesAuthVersion', safeExtGet('googlePlayServicesVersion', '16.0.1'))
+ implementation "com.google.android.gms:play-services-auth:$googlePlayServicesAuthVersion"
}
apply from: file("./firebase-json.gradle")
I'm using current stable of literally every package at time of this typing, so I think taking the test project and doing a yarn upgrade --outdated && cd ios && rm -f Podfile.lock && pod install --repo-update
along with the crashlytics migration and updating gradle to 6.5.1 and gradle plugin to 4.0.0 might reproduce it
At worst, that would have the test project up to date :-)
Click To Expand
#### Have you converted to AndroidX? - [ ] my application is an AndroidX application? - [ ] I am using `android/gradle.settings` `jetifier=true` for Android compatibility? - [ ] I am using the NPM package `jetifier` for react-native compatibility? #### `android/build.gradle`:
#### `android/app/build.gradle`:
// N/A
#### `android/settings.gradle`:
// N/A
#### `MainApplication.java`:
// N/A
#### `AndroidManifest.xml`:
<!-- N/A -->
Click To Expand
**`react-native info` output:**
OUTPUT GOES HERE
- **Platform that you're experiencing the issue on**:
- [ ] iOS
- [ ] Android
- [ ] **iOS** but have not tested behavior on Android
- [ ] **Android** but have not tested behavior on iOS
- [ ] Both
- **`react-native-firebase` version you're using that has this issue:**
- `e.g. 5.4.3`
- **`Firebase` module(s) you're using that has the issue:**
- `e.g. Instance ID`
- **Are you using `TypeScript`?**
- `Y/N` & `VERSION`
- **Are you using `Expo`?**
- `Y` & `SDK VERSION`
React Native Firebase
and Invertase
on Twitter for updates on the library.@russellwheatley I think (from Mike D) that you were thinking of looking at this - just wanted to mention I was able to reproduce 2 current build failures on master for android with https://github.com/mikehardy/rnfbdemo/blob/master/make-demo-v6.sh which I just updated now and you can see the failure or not by running the linked patch or not
The demo script is a step-by-step build of an RNFB project from scratch though so it should be easy to see if the script is doing something silly (always possible!) or if the RNFB bug is real like I think it is
I have a weak hunch it is https://github.com/invertase/react-native-firebase/commit/65042d08ed1233cfdb35b6c2d51d87be2d305d3c
But I also vaguely recall some gradle init change for notifee (obviousy unrelated but might rhyme with this) https://github.com/notifee/react-native-notifee/pull/100 where gradle init order was altered
Thanks for the update, @mikehardy. I'll use your demo as a basis for the bug reproduction :).
I apologize in advance if the repo just clearly shows that I'm doing something lame / not following the docs and that's the bug :see_no_evil:
hey @mikehardy, I haven't been able to reproduce the build error via the test
app after making changes mentioned in the PR #3956. I also created a throwaway RN project using RN CLI, installing only @react-native-firebase/app
which it built without error. I also added iid
& crashlytics
packages & rebuilt without any error.
The only time I encountered the error was with the RN project the build script installed. This seems to dovetail with the fact that no one else has chimed in with this particular problem (yet!). I think this might be one to keep an eye on for now 馃槃 .
Yeah, it's got to be in something I'm doing, and while updating the test app has a tangent benefit for the project as a whole (which is why I was hoping for that, with a chance of repro) I understand it must be something I'm doing. I'll keep digging. Strange one, I appreciate your keeping an eye open for it while buffing up the test app
@mikehardy It's this line of code that causes the build error I think: https://github.com/mikehardy/rnfbdemo/blob/master/make-demo-v6.sh#L34
At least, I removed it and it built successfully.
@russellwheatley "but but but..." -> https://rnfirebase.io/#android - I think I am following the docs correctly? Does engaging the android BoM override do it then? I do that in my work project and the demo (I see this in both) but test doesn't. Could you try overriding android BoM in the test app, if that does it, we have a repro! 25.6.0 is current
You're definitely doing it right, I just need to find out what is going on. Will have a look into this on Monday.
@russellwheatley I know you guys prioritize things internally, just wanted to bump this since Monday passed and I was just noticing I'm still carrying these patch-package patches to workaround
@mikehardy I think my eyes deceived me last time, but I've noticed that you're piping your config overrides into android/build.gradle
when it appears it should be copied into android/app/build.gradle
as per documentation. I've just tested and it builds without problems 馃憤
what in the !?! good catch. Just for unix purism that's "appending via output redirect" versus the other in-place sed edits I do. Back on me for sure, thanks @russellwheatley
@russellwheatley I had time to take another round on this (and I've got more time in general to spend on react-native-firebase now, so I can pursue it)
version overrides: The script line you mentioned is actually correct - I think the documentation for android overrides may need a tweak as if you follow https://rnfirebase.io/#android and put it in android/app/build.gradle
the overrides do not actually occur - you can see the output from the gradle versioning plugin saying it's using the default, but if you put them in android/build.gradle
as my script did with a straight append prior, the plugin shows the override working correctly with expected version numbers
app dependency need: I still need the app dependency patched as mentioned. My script actually applies the patch I'm contemplating: https://github.com/mikehardy/rnfbdemo/blob/eda24a71990e95e8a91b17b27b0cc1417031808b/make-demo.sh#L163-L164 / https://github.com/mikehardy/rnfbdemo/blob/master/patches/%40react-native-firebase%2Bapp%2B8.3.0.patch - so it is only by removing that patch from patches prior to running (what is now called) make-demo.sh
do you see the failure I see
At any rate, I'm going to dive into testing soon so I'll see if I can't reproduce it within the test app itself
I have this reproducing locally after making 4 changes at once in the process of updating the test app. That's poor test hygiene so I'll narrow it down the actual change that triggers this, then formulate a PR
Current patch (vs current version)