I'm using react-native-firebase with RN 0.59.8 (without AndroidX). I use reverse-jetify as a post-install script. During android build I come up with following build error which is apparently due to androidX issues. As of now I cannot migrate to AndroidX.
```/Users//node_modules/@react-native-firebase/app/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseAppRegistrar.java:20: error: package android.support.annotation does not exist
import android.support.annotation.Keep;
^
/Users//node_modules/@react-native-firebase/app/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseAppRegistrar.java:31: error: cannot find symbol
@Keep
^
symbol: class Keep
/Users//node_modules/@react-native-firebase/app/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseInitProvider.java:26: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
^
/Users//node_modules/@react-native-firebase/app/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseEventEmitter.java:22: error: package android.support.annotation does not exist
import android.support.annotation.MainThread;
^
/Users//node_modules/@react-native-firebase/app/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseInitProvider.java:71: error: cannot find symbol
@Nullable
^
symbol: class Nullable
location: class ReactNativeFirebaseInitProvider
/Users//node_modules/@react-native-firebase/app/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseInitProvider.java:79: error: cannot find symbol
@Nullable
^
symbol: class Nullable
location: class ReactNativeFirebaseInitProvider
/Users//node_modules/@react-native-firebase/app/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseInitProvider.java:85: error: cannot find symbol
@Nullable
^
symbol: class Nullable
location: class ReactNativeFirebaseInitProvider
/Users//node_modules/@react-native-firebase/app/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseEventEmitter.java:121: error: cannot find symbol
@MainThread
^
symbol: class MainThread
location: class ReactNativeFirebaseEventEmitter
/Users/*/node_modules/@react-native-firebase/app/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseEventEmitter.java:133: error: cannot find symbol
@MainThread
^
symbol: class MainThread
location: class ReactNativeFirebaseEventEmitter
## Project Files
<!-- Provide the contents of key project files which will help to debug -->
<!-- For Example: -->
<!-- - iOS: `Podfile` contents. -->
<!-- - Android: `android/build.gradle` contents. -->
<!-- - Android: `android/app/build.gradle` contents. -->
<!-- - Android: `AndroidManifest.xml` contents. -->
<!-- ADD THE CONTENTS OF THE FILES IN THE PROVIDED CODE BLOCKS BELOW -->
### Android
<details><summary>Click To Expand</summary>
<p>
#### Have you converted to AndroidX?
<!--- Mark any options that apply below -->
- [ ] my application is an AndroidX application?
- [ ] I am using `android/gradle.settings` `jetifier=true` for Android compatibility?
- [x] I am using the NPM package `jetifier` for react-native compatibility?
#### `android/build.gradle`:
```groovy
// N/A
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:**
React Native Environment Info:
System:
OS: macOS 10.15.2
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Memory: 66.59 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.16.2 - /usr/local/bin/node
Yarn: 1.3.2 - /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 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
Android SDK:
API Levels: 23, 25, 26, 27, 28, 29
Build Tools: 23.0.1, 25.0.0, 25.0.1, 25.0.2, 26.0.0, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.2, 28.0.3
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5977832
Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.3 => 16.8.3
react-native: 0.59.8 => 0.59.8
npmGlobalPackages:
create-react-native-app: 1.0.0
- **Platform that you're experiencing the issue on**:
- [ ] iOS
- [x] 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:**
- `6.4.0`
- **`Firebase` module(s) you're using that has the issue:**
- `App`
- **Are you using `TypeScript`?**
- `N`
React Native Firebase and Invertase on Twitter for updates on the library.react-native-firebase v6 is only supported for react-native 0.60+
This will sound harsh but please understand I wrote the jetifier you are using because I understand the pain of the upgrade from RN59 to RN60+ and the AndroidX switch. I sympathize - I wrote it to support people that had to delay. The harsh part is that you are out of time though - you really need to upgrade
Luckily, the Android Studio process to do the upgrade (and then jetifier but in the forward direction) make it not so painful. The hardest part for me after that was the Xcode iOS part - converting to cocoapods etc. No sugar-coating that, it's painful. But RN60 is needed for proper support of Xcode 11 (which is needed for iOS13 etc) and it's been about a year now
You may be able to work around this by adding an annotation dependency in your app/build.gradle but I'm not sure
@mikehardy Yes I will consider the upgrade sometime in the future. Until then I will be using V5.
Btw, I really appreciate the brand new docs page, however, there is no statement about react-native-firebase v6 is only supported for react-native 0.60+ which may be confusing.
@Salakar this is a fair point - https://rnfirebase.io/#prerequisites could perhaps state RN60+ as a requirement (and if I am not mistaken, also iOS10+ but I could be wrong there)
The supported versions matrix for v5 was a bit gnarly but was still useful to refer people to: https://v5.rnfirebase.io/docs/v5.x.x/getting-started#Supported-versions---React-Native-/-Firebase
Most helpful comment
@Salakar this is a fair point - https://rnfirebase.io/#prerequisites could perhaps state RN60+ as a requirement (and if I am not mistaken, also iOS10+ but I could be wrong there)
The supported versions matrix for v5 was a bit gnarly but was still useful to refer people to: https://v5.rnfirebase.io/docs/v5.x.x/getting-started#Supported-versions---React-Native-/-Firebase