Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React native firebase - android not able to build

For some reason I am unable to build my project. Yesterday everything worked fine, looking at https://firebase.google.com/support/release-notes/android#update_-_april_02_2019 there is a critical update from 5/11/21.

I tried to change the minSdkVersion as suggested but still no resolution.

This is the error:

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
C:\Users\Gilad\SaveLatestJoyRide-FE\joyride-fe\node_modules\react-native-push-notification\android\src\main\java\com\dieam\reactnativepushnotification\modules\RNPushNotification.java:39: error: cannot find symbol
import com.google.firebase.iid.FirebaseInstanceId;
                              ^
  symbol:   class FirebaseInstanceId
  location: package com.google.firebase.iid
C:\Users\Gilad\SaveLatestJoyRide-FE\joyride-fe\node_modules\react-native-push-notification\android\src\main\java\com\dieam\reactnativepushnotification\modules\RNPushNotification.java:40: error: cannot find symbol
import com.google.firebase.iid.InstanceIdResult;
                              ^
  symbol:   class InstanceIdResult
  location: package com.google.firebase.iid
C:\Users\Gilad\SaveLatestJoyRide-FE\joyride-fe\node_modules\react-native-push-notification\android\src\main\java\com\dieam\reactnativepushnotification\modules\RNPushNotification.java:143: error: cannot find symbol
              .addOnCompleteListener(new OnCompleteListener<InstanceIdResult>() {
                                                            ^
  symbol:   class InstanceIdResult
  location: class RNPushNotification
C:\Users\Gilad\SaveLatestJoyRide-FE\joyride-fe\node_modules\react-native-push-notification\android\src\main\java\com\dieam\reactnativepushnotification\modules\RNPushNotification.java:145: error: cannot find symbol
                  public void onComplete(@NonNull Task<InstanceIdResult> task) {
                                                       ^
  symbol: class InstanceIdResult
C:\Users\Gilad\SaveLatestJoyRide-FE\joyride-fe\node_modules\react-native-push-notification\android\src\main\java\com\dieam\reactnativepushnotification\modules\RNPushNotification.java:142: error: cannot find symbol
      FirebaseInstanceId.getInstance().getInstanceId()
      ^
  symbol:   variable FirebaseInstanceId
  location: class RNPushNotification
C:\Users\Gilad\SaveLatestJoyRide-FE\joyride-fe\node_modules\react-native-push-notification\android\src\main\java\com\dieam\reactnativepushnotification\modules\RNPushNotification.java:289: error: cannot find symbol
                  FirebaseInstanceId.getInstance().deleteInstanceId();
                  ^
  symbol: variable FirebaseInstanceId
Note: C:\Users\Gilad\SaveLatestJoyRide-FE\joyride-fe\node_modules\react-native-push-notification\android\src\main\java\com\dieam\reactnativepushnotification\modules\RNPushNotificationHelper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\Users\Gilad\SaveLatestJoyRide-FE\joyride-fe\node_modules\react-native-push-notification\android\src\main\java\com\dieam\reactnativepushnotification\modules\RNPushNotification.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
6 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-push-notification:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

Please help! :(

like image 576
Gilad Dahan Avatar asked May 12 '21 11:05

Gilad Dahan


1 Answers

just add the following under android/build.gradle

buildscript {
    ext {
    .....
    firebaseMessagingVersion = "21.1.0"
}
like image 166
Ahmad hassan Avatar answered Sep 27 '22 20:09

Ahmad hassan