Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android 7.0 - Auth is not working with version firebase 7.1.0 #3693

Closed
2 of 10 tasks
keremcubuk opened this issue May 26, 2020 · 6 comments
Closed
2 of 10 tasks

Android 7.0 - Auth is not working with version firebase 7.1.0 #3693

keremcubuk opened this issue May 26, 2020 · 6 comments

Comments

@keremcubuk
Copy link

Issue

I'm developing a react-native app and I upgrade the version of firebase 7.1.0 from 6.7.1 after update the packages. I realized that it wasn't working. When I try to email login nothing happen. However, It works Android API 26,28,29 and IOS 13 which I've tested.

import auth from '@react-native-firebase/auth';

  const handleSignIn = () => {
    auth()
      .signInWithEmailAndPassword(userEmail, userPass)
      .then(response => {
        console.log(response);
      })
      .catch(error => {
        console.log(error);
      });
  }

Project Files

Javascript

Click To Expand

package.json:

{
  "dependencies": {
    "@react-native-community/async-storage": "^1.10.3",
    "@react-native-community/masked-view": "^0.1.10",
    "@react-native-firebase/app": "^7.1.0",
    "@react-native-firebase/auth": "^7.1.0",
    "@react-native-firebase/firestore": "^7.1.0",
    "@react-navigation/bottom-tabs": "^5.4.7",
    "@react-navigation/native": "^5.4.2",
    "@react-navigation/stack": "^5.3.9",
    "axios": "^0.19.2",
    "buffer": "^5.6.0",
    "i18next": "^19.4.4",
    "immer": "^6.0.8",
    "native-base": "^2.13.12",
    "react": "^16.13.1",
    "react-native": "0.61.5",
    "react-native-gesture-handler": "^1.6.1",
    "react-native-image-picker": "^2.3.1",
    "react-native-keyboard-aware-scroll-view": "^0.9.1",
    "react-native-localize": "^1.4.0",
    "react-native-safe-area-context": "^2.0.0",
    "react-native-screens": "^2.8.0",
    "react-native-vector-icons": "^6.6.0",
    "react-redux": "^7.2.0",
    "redux-saga": "^1.1.3",
    "reselect": "^4.0.0",
    "stream": "0.0.2",
    "xml-js": "^1.6.11"
  },
  "devDependencies": {
    "@babel/core": "7.7.2",
    "@babel/runtime": "7.7.2",
    "@react-native-community/eslint-config": "0.0.5",
    "babel-jest": "24.9.0",
    "babel-plugin-module-resolver": "3.2.0",
    "eslint": "6.6.0",
    "jest": "24.9.0",
    "metro-react-native-babel-preset": "0.56.3",
    "plop": "^2.6.0",
    "react-test-renderer": "16.9.0"
  }
}

firebase.json for react-native-firebase v6:

# N/A

iOS

Click To Expand

ios/Podfile:

  • I'm not using Pods
  • I'm using Pods and my Podfile looks like:
# N/A

AppDelegate.m:

// N/A


Android

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:

// N/A

android/app/build.gradle:

// N/A

android/settings.gradle:

// N/A

MainApplication.java:

// N/A

AndroidManifest.xml:

<!-- N/A -->


Environment

Click To Expand

react-native info output:

System:
    OS: macOS Mojave 10.14.6
    CPU: (8) x64 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
    Memory: 22.10 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 10.15.3 - /usr/local/bin/node
    Yarn: 1.22.0 - /usr/local/bin/yarn
    npm: 6.4.1 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.0, DriverKit 19.0, macOS 10.15, tvOS 13.0, watchOS 6.0
    Android SDK:
      API Levels: 23, 25, 26, 27, 28, 29
      Build Tools: 26.0.2, 28.0.0, 28.0.3, 29.0.0
      System Images: android-24 | Google Play Intel x86 Atom, android-26 | Google Play Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom
      Android NDK: 20.0.5594570
  IDEs:
    Android Studio: 3.6 AI-192.7142.36.36.6308749
    Xcode: 11.0/11A420a - /usr/bin/xcodebuild
  npmPackages:
    react: ^16.13.1 => 16.13.1 
    react-native: 0.61.5 => 0.61.5 
  npmGlobalPackages:
    react-native-cli: 2.0.1
    react-native-rename: 2.4.1
  • 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:
    • 7.1.0
  • Firebase module(s) you're using that has the issue:
    • e.g. Instance ID
  • Are you using TypeScript?
    • N


@mikehardy
Copy link
Collaborator

"is not working" -> do you have some evidence? results of API calls that differ (with specifics)? Some adb logcat or Xcode log trace?

@mikehardy
Copy link
Collaborator

Also - the firebase SDKs should have updated. You skipped that part of the template. Make sure you have the current stable Firebase SDKs in android and iOS and try npx reat-native-clean-project to blow out old state from the upgrade

@keremcubuk
Copy link
Author

keremcubuk commented May 28, 2020

I have tried the clean project with npx react-native-clean-project. Not solved. Moreover, In my android logcat, I'm getting this error.

Not Working Version:

API 24: Android 7.0

21705-21705/com.myapp W/IInputConnectionWrapper: finishComposingText on inactive InputConnection
21705-21705/com.myapp W/IInputConnectionWrapper: finishComposingText on inactive InputConnection
21705-21783/com.myapp D/Auth: signInWithEmailAndPassword
21705-21783/com.myapp I/BiChannelGoogleApi: [FirebaseAuth: ] getGoogleApiForMethod() returned Gms: com.google.firebase.auth.api.internal.zzaq@c64e91e
21705-21739/com.myapp W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
21705-21739/com.myapp W/GooglePlayServicesUtil: Google Play services out of date.  Requires 12451000 but found 11743470

Working Version

API 26: Android 8.0

21594-21734/com.bookbase D/Auth: signInWithEmailAndPassword
21594-21734/com.bookbase I/BiChannelGoogleApi: [FirebaseAuth: ] getGoogleApiForMethod() returned Gms: com.google.firebase.auth.api.internal.zzaq@86d3251
21594-21634/com.bookbase D/FirebaseAuth: Notifying id token listeners about user ( bce60LNMepTC1ahAgt8Kszyz3S43 ).
21594-21634/com.bookbase D/FirebaseAuth: Notifying auth state listeners about user ( bce60LNMepTC1ahAgt8Kszyz3S43 ).
21594-21594/com.bookbase D/Auth: addAuthStateListener:eventBody { NativeMap: {"user":{"metadata":{"lastSignInTime":1590693994116,"creationTime":1588535472183},"providerData":[{"email":"[email protected]","phoneNumber":null,"photoURL":null,"displayName":"Kerem Çubuk","uid":"[email protected]","providerId":"password"}],"phoneNumber":null,"photoURL":null,"displayName":"Kerem Çubuk","email":"[email protected]","isAnonymous":false,"emailVerified":false,"providerId":"firebase","uid":"bce60LNMepTC1ahAgt8Kszyz3S43"},"appName":"[DEFAULT]"} }

I've just only implemented gms and firebase analytics manually. All other, firebase features are autolinked.

android/build.gradle

dependencies {
    classpath("com.android.tools.build:gradle:3.4.2")

     // Firebase
    classpath 'com.google.gms:google-services:4.3.3'
}

android/app/build.gradle

dependencies {
    implementation 'com.google.firebase:firebase-analytics:17.2.2'
}

I think these information help us for resolve problem 😃

@mikehardy
Copy link
Collaborator

device play services out of date according to your android 7.0 log. How does it go when you follow the natural path from the log message (updating play services)?

@keremcubuk
Copy link
Author

keremcubuk commented May 28, 2020

I reset the device by making wipe data. The problem persisted. Then I logged in with my Gmail account. I updated "Google Play Services" on Google play and it worked.

After updating device play services version:
Screen Shot 2020-05-28 at 23 36 34

I am curious about users who have not made this update on their phones. Any idea about this case?

@mikehardy
Copy link
Collaborator

users update that normally, I've not seen it happen in the wild.
If you want to make sure then for react-native-firebase v6+ you are waiting on this PR
#3601

Or you can use this from my rn-update-apk module (which is useful in that it patches SSL on older devices anyway)

https://github.com/mikehardy/react-native-update-apk/blob/4bda32ee7b935a2e845601b62740a55f80c78297/example/App.js#L116-L137

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants