invertase / react-native-firebase

🔥 A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.
https://rnfirebase.io
Other
11.53k stars 2.19k forks source link

Error after updating react-native-firebase to 4.0.3 #991

Closed Luckygirlllll closed 6 years ago

Luckygirlllll commented 6 years ago

Issue

After updating react-native-firebase to the version 4.0.3, I'm getting such errors:

Android:

/Users/iryna/Documents/Projects/hoops-23_03_2018/hoops/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/firestore/RNFirebaseFirestore.java:53: error: cannot find symbol getFirestoreForApp(appName).disableNetwork().addOnCompleteListener(new OnCompleteListener() { ^ symbol: method disableNetwork() location: class FirebaseFirestore /Users/iryna/Documents/Projects/hoops-23_03_2018/hoops/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/firestore/RNFirebaseFirestore.java:78: error: cannot find symbol getFirestoreForApp(appName).enableNetwork().addOnCompleteListener(new OnCompleteListener() { ^ symbol: method enableNetwork() location: class FirebaseFirestore /Users/iryna/Documents/Projects/hoops-23_03_2018/hoops/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/admob/RNFirebaseAdMobRewardedVideo.java:95: error: method does not override or implement a method from a supertype @Override ^ /Users/iryna/Documents/Projects/hoops-23_03_2018/hoops/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/invites/RNFirebaseInvites.java:169: error: cannot find symbol mPromise.resolve(Arguments.fromList(Arrays.asList(ids))); ^ symbol: method fromList(List) location: class Arguments Note: /Users/iryna/Documents/Projects/hoops-23_03_2018/hoops/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/RNFirebaseNotificationManager.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.

4 errors

IOS:

/Users/iryna/Documents/Projects/hoops-23_03_2018/hoops/ios/Hoops/AppDelegate.m:34:27: error: no known class method for selector 'application:openURL:options:' return [RNFirebaseLinks application:application ^~~~~~~ /Users/iryna/Documents/Projects/hoops-23_03_2018/hoops/ios/Hoops/AppDelegate.m:42:27: error: no known class method for selector 'application:continueUserActivity:restorationHandler:' return [RNFirebaseLinks application:application

Environment

Both

  1. Application Target Platform:

macOS High Sierra

  1. Development Operating System:

Xcode 10.2 Android studio 3.0.1

  1. Build Tools:
  1. React Native version:

0.47.2

  1. RNFirebase Version:

4.0.3

  1. Firebase Module:

dynamic links

Salakar commented 6 years ago

You'll also need to upgrade your firebase SDK versions and gradle as well for v4, see the upgrade guide on the v4 realase notes: https://rnfirebase.io/docs/v4.0.x/release-notes#Upgrade-instructions

Sleepful commented 6 years ago

Same error here (started happening today), we followed the upgrade instructions but this did not solve the issue.

Fixed with the following:

Had to change the next line in package.json

    "react-native-firebase": "^4.0.5",

to

    "react-native-firebase": "4.0.0",

deleted package-lock.json and ran npm install again

also re-download google-services.json from firebase as we were getting this error:

> Task :app:processDebugGoogleServices FAILED
Parsing json file: ...\android\app\google-services.json

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugGoogleServices'.
> Failed to delete: ...\android\app\build\generated\res\google-services\debug
tierfour commented 6 years ago

Don't forget to update your project global settings if you set them in android/build.gradle

I changed:

ext {
    compileSdkVersion           = 26
    targetSdkVersion            = 26
    buildToolsVersion           = "26.0.2"
    googlePlayServicesVersion   = "11.8.0"
    supportLibVersion           = "27.1.0"
}

to

ext {
    compileSdkVersion           = 26
    targetSdkVersion            = 26
    buildToolsVersion           = "26.0.2"
    googlePlayServicesVersion   = "12.0.1"
    supportLibVersion           = "27.1.0"
}
MounirDhahri commented 4 years ago

For dynamic links on iOS, you need to make a subtle change to your AppDelegate.m


- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
options:(NSDictionary<NSString *, id> *)options {
return [[RNFirebaseLinks instance] application:application openURL:url options:options];
}