{"action":"created","issue":{"url":"https://api.github.com/repos/invertase/react-native-firebase/issues/823","repository_url":"https://api.github.com/repos/invertase/react-native-firebase","labels_url":"https://api.github.com/repos/invertase/react-native-firebase/issues/823/labels{/name}","comments_url":"https://api.github.com/repos/invertase/react-native-firebase/issues/823/comments","events_url":"https://api.github.com/repos/invertase/react-native-firebase/issues/823/events","html_url":"https://github.com/invertase/react-native-firebase/issues/823","id":295732311,"number":823,"title":"App crash when using firebase.auth().signInWithCredential(credential)","user":{"login":"AlexandreMaistret","id":14938428,"avatar_url":"https://avatars2.githubusercontent.com/u/14938428?v=4","gravatar_id":"","url":"https://api.github.com/users/AlexandreMaistret","html_url":"https://github.com/AlexandreMaistret","followers_url":"https://api.github.com/users/AlexandreMaistret/followers","following_url":"https://api.github.com/users/AlexandreMaistret/following{/other_user}","gists_url":"https://api.github.com/users/AlexandreMaistret/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexandreMaistret/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexandreMaistret/subscriptions","organizations_url":"https://api.github.com/users/AlexandreMaistret/orgs","repos_url":"https://api.github.com/users/AlexandreMaistret/repos","events_url":"https://api.github.com/users/AlexandreMaistret/events{/privacy}","received_events_url":"https://api.github.com/users/AlexandreMaistret/received_events","type":"User","site_admin":false},"labels":[{"id":566539156,"url":"https://api.github.com/repos/invertase/react-native-firebase/labels/awaiting-user-feedback","name":"awaiting-user-feedback","color":"5319e7","default":false},{"id":626931532,"url":"https://api.github.com/repos/invertase/react-native-firebase/labels/installation","name":"installation","color":"006b75","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-09T02:13:40Z","updated_at":"2018-02-09T15:52:19Z","closed_at":null,"author_association":"NONE","body":"**ISSUE**\r\n\r\nHello everyone,\r\n\r\nI've just install this library, but the app crashs when launching `firebase.auth().signInWithCredential(credential);`\r\n\r\nHere is my code : \r\n\r\n    let result = await LoginManager.logInWithReadPermissions(['public_profile', 'user_friends']);\r\n\r\n    //Get access token\r\n    let data = await AccessToken.getCurrentAccessToken();\r\n    let accessToken = data.accessToken;\r\n\r\n    const credential = await firebase.auth.FacebookAuthProvider.credential(accessToken);\r\n    console.log(credential);\r\n\r\n    //Create user in firebase\r\n    await firebase.auth().signInWithCredential(credential);\r\n\r\n    const DatabaseToken = await firebase.auth().currentUser.getIdToken();\r\n    console.log(DatabaseToken);\r\n\r\nThe `console.log(credential)` is printed, but the `console.log(DatabaseToken)` isn't.\r\n\r\nIn the logs, I've got this error message : \r\n\r\n```\r\nFATAL EXCEPTION: main\r\n                                                            Process: com.MYAPPNAME PID: 13610\r\n                                                            java.lang.NoSuchMethodError: No virtual method getMetadata()Lcom/google/firebase/auth/FirebaseUserMetadata; in class Lcom/google/firebase/auth/FirebaseUser; or its super classes (declaration of 'com.google.firebase.auth.FirebaseUser' appears in /data/app/com.MYAPPNAME-4/base.apk)\r\n                                                                at io.invertase.firebase.auth.RNFirebaseAuth.firebaseUserToMap(RNFirebaseAuth.java:1551)\r\n                                                                at io.invertase.firebase.auth.RNFirebaseAuth.access$000(RNFirebaseAuth.java:59)\r\n                                                                at io.invertase.firebase.auth.RNFirebaseAuth$1.onAuthStateChanged(RNFirebaseAuth.java:98)\r\n                                                                at com.google.firebase.auth.zzi.run(Unknown Source)\r\n                                                                at android.os.Handler.handleCallback(Handler.java:751)\r\n                                                                at android.os.Handler.dispatchMessage(Handler.java:95)\r\n                                                                at android.os.Looper.loop(Looper.java:167)\r\n                                                                at android.app.ActivityThread.main(ActivityThread.java:6119)\r\n                                                                at java.lang.reflect.Method.invoke(Native Method)\r\n                                                                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)\r\n                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)\r\n```\r\n\r\nThese are my dependencies in android Studio : \r\n\r\n\r\n    dependencies {\r\n    compile(project(':react-native-firebase')) {\r\n        transitive = false\r\n    }\r\n    compile project(':react-native-device-info')\r\n    compile project(':react-native-fetch-blob')\r\n    compile project(':react-native-localization')\r\n    compile project(':react-native-view-shot')\r\n    compile project(':react-native-image-picker')\r\n    compile project(':react-native-fs')\r\n    compile project(':react-native-camera')\r\n    compile project(':react-native-fbsdk')\r\n    compile(project(':react-native-maps')) {\r\n        exclude group: 'com.google.android.gms', module: 'play-services-base'\r\n        exclude group: 'com.google.android.gms', module: 'play-services-maps'\r\n    }\r\n    compile 'com.google.android.gms:play-services-base:11.4.2'\r\n    compile \"com.google.android.gms:play-services-auth:11.4.2\"\r\n    compile 'com.google.android.gms:play-services-gcm:11.4.2'\r\n    compile 'com.google.android.gms:play-services-maps:11.4.2'\r\n    compile 'com.google.android.gms:play-services-location:11.4.2'\r\n    compile \"com.google.firebase:firebase-core:11.4.2\"\r\n    compile \"com.google.firebase:firebase-storage:11.4.2\"\r\n    compile \"com.google.firebase:firebase-auth:11.4.2\"\r\n    compile project(':react-native-vector-icons')\r\n    compile project(':react-native-linear-gradient')\r\n    compile project(':react-native-system-setting')\r\n    compile project(':react-native-android-location-services-dialog-box')\r\n    compile(project(':react-native-background-geolocation')) {\r\n        exclude group: 'com.google.android.gms', module: 'play-services-location'\r\n    }\r\n    compile fileTree(dir: \"libs\", include: [\"*.jar\"])\r\n    compile \"com.android.support:appcompat-v7:26.0.2\"\r\n    compile \"com.facebook.react:react-native:+\"  // From node_modules\r\n    compile 'com.facebook.android:facebook-android-sdk:[4,5)'\r\n    }\r\n\r\nI've already tried to change all the versions of the `play-services dependencies` and `firebase dependencies`  to `11.6.0` and to `11.8.0`, it immediately crashs the app. \r\n\r\n**ENVIRONNEMENT**\r\n\r\nreact-native : 0.51.0\r\nApp create with `react-native init`\r\nAndroid Studio : 3.0.1\r\nTested on real device WIKO"},"comment":{"url":"https://api.github.com/repos/invertase/react-native-firebase/issues/comments/364472753","html_url":"https://github.com/invertase/react-native-firebase/issues/823#issuecomment-364472753","issue_url":"https://api.github.com/repos/invertase/react-native-firebase/issues/823","id":364472753,"user":{"login":"AlexandreMaistret","id":14938428,"avatar_url":"https://avatars2.githubusercontent.com/u/14938428?v=4","gravatar_id":"","url":"https://api.github.com/users/AlexandreMaistret","html_url":"https://github.com/AlexandreMaistret","followers_url":"https://api.github.com/users/AlexandreMaistret/followers","following_url":"https://api.github.com/users/AlexandreMaistret/following{/other_user}","gists_url":"https://api.github.com/users/AlexandreMaistret/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexandreMaistret/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexandreMaistret/subscriptions","organizations_url":"https://api.github.com/users/AlexandreMaistret/orgs","repos_url":"https://api.github.com/users/AlexandreMaistret/repos","events_url":"https://api.github.com/users/AlexandreMaistret/events{/privacy}","received_events_url":"https://api.github.com/users/AlexandreMaistret/received_events","type":"User","site_admin":false},"created_at":"2018-02-09T15:52:19Z","updated_at":"2018-02-09T15:52:19Z","author_association":"NONE","body":"Hi @chrisbianca \r\n\r\nSo I have set everything to 11.8.0 and this is the err message : \r\n\r\n    02-09 16:30:46.648 1883-2111/com.MYAPPNAME E/ReactNativeJS: Java exception in 'NativeModules'\r\n                                                         \r\n    java.lang.NoSuchMethodError: No static method \r\n    getNoBackupFilesDir(Landroid/content/Context;)Ljava/io/File; in class \r\n    Lcom/google/android/gms/common/util/zzu; or its super classes (declaration of \r\n    'com.google.android.gms.common.util.zzu' appears in /data/app/com.MYAPPNAME-4/base.apk)\r\n\r\nMy dependencies :\r\n \r\n    dependencies {\r\n    compile(project(':react-native-firebase')) {\r\n        transitive = false\r\n    }\r\n    compile project(':react-native-device-info')\r\n    compile project(':react-native-fetch-blob')\r\n    compile project(':react-native-localization')\r\n    compile project(':react-native-view-shot')\r\n    compile project(':react-native-image-picker')\r\n    compile project(':react-native-fs')\r\n    compile project(':react-native-camera')\r\n    compile project(':react-native-fbsdk')\r\n    compile(project(':react-native-maps')) {\r\n        exclude group: 'com.google.android.gms', module: 'play-services-base'\r\n        exclude group: 'com.google.android.gms', module: 'play-services-maps'\r\n    }\r\n    compile 'com.google.android.gms:play-services-base:11.8.0'\r\n    compile \"com.google.android.gms:play-services-auth:11.8.0\"\r\n    compile 'com.google.android.gms:play-services-gcm:11.8.0'\r\n    compile 'com.google.android.gms:play-services-maps:11.8.0'\r\n    compile 'com.google.android.gms:play-services-location:11.8.0'\r\n    compile \"com.google.firebase:firebase-core:11.8.0\"\r\n    compile \"com.google.firebase:firebase-storage:11.8.0\"\r\n    compile \"com.google.firebase:firebase-auth:11.8.0\"\r\n    compile project(':react-native-vector-icons')\r\n    compile project(':react-native-linear-gradient')\r\n    compile project(':react-native-system-setting')\r\n    compile project(':react-native-android-location-services-dialog-box')\r\n    compile(project(':react-native-background-geolocation')) {\r\n        exclude group: 'com.google.android.gms', module: 'play-services-location'\r\n    }\r\n    compile fileTree(dir: \"libs\", include: [\"*.jar\"])\r\n    compile \"com.android.support:appcompat-v7:26.1.0\"\r\n    compile \"com.facebook.react:react-native:+\"  // From node_modules\r\n    compile 'com.facebook.android:facebook-android-sdk:[4,5)'\r\n    }\r\n\r\nI don't realy understand the err message. Also, Android Studio tell me this warning, which I don't really understand since  `com.google.android.gms:play-services-gcm:11.8.0` is specified in the dependencies to use 11.8.0: \r\n\r\n    All gms/firebase libraries must use the exact same version specification (mixing versions can lead to \r\n    runtime crashes). Found versions 11.8.0, 11.4.2. Examples include com.google.android.gms:play-\r\n    services-auth:11.8.0 and com.google.android.gms:play-services-gcm:11.4.2"}}
{"actor":{"display_login":"AlexandreMaistret"}}