react-native-firebase icon indicating copy to clipboard operation
react-native-firebase copied to clipboard

[🐛] auth signInWithEmailAndPassword -> Malformed calls from JS: field sizes are different

Open franamu opened this issue 3 years ago • 3 comments

Issue

Method signInWithEmailAndPassword from auth doesnt work correctly. Code example:

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

try {
 const resp = await auth().signInWithEmailAndPassword('[email protected]', 'pepe123');
} carch (error) {
console.log('error login', error);
}

Console output:

error login [Error: Exception in HostFunction: Malformed calls from JS: field sizes are different.

[[25,33],[1,0],[[852,100,1671577388602,false]],4324]]

Project Files

Javascript

Click To Expand

package.json:

{
  "scripts": {
    "start": "expo start --dev-client",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "@expo/config-plugins": "^5.0.0",
    "@gorhom/bottom-sheet": "^4",
    "@react-native-async-storage/async-storage": "~1.17.3",
    "@react-native-community/datetimepicker": "6.2.0",
    "@react-native-community/masked-view": "0.1.10",
    "@react-native-community/slider": "4.2.3",
    "@react-native-firebase/analytics": "^16.5.0",
    "@react-native-firebase/app": "^16.5.0",
    "@react-native-firebase/auth": "^16.5.0",
    "@react-native-firebase/firestore": "^16.5.0",
    "@react-native-firebase/storage": "^16.5.0",
    "@react-native-picker/picker": "2.4.2",
    "@react-navigation/bottom-tabs": "^5.11.10",
    "@react-navigation/native": "^5.9.4",
    "@react-navigation/stack": "^5.14.4",
    "@sentry/react-native": "4.2.2",
    "axios": "^0.20.0",
    "expo": "~46.0.16",
    "expo-app-loading": "~2.1.0",
    "expo-apple-authentication": "~4.3.0",
    "expo-application": "~4.2.2",
    "expo-barcode-scanner": "~11.4.0",
    "expo-build-properties": "~0.3.0",
    "expo-camera": "~12.3.0",
    "expo-constants": "~13.2.4",
    "expo-dev-client": "~1.3.1",
    "expo-device": "~4.3.0",
    "expo-document-picker": "~10.3.0",
    "expo-font": "~10.2.0",
    "expo-image-picker": "~13.3.1",
    "expo-linear-gradient": "~11.4.0",
    "expo-linking": "~3.2.2",
    "expo-location": "~14.3.0",
    "expo-notifications": "~0.16.1",
    "expo-permissions": "~13.2.0",
    "expo-splash-screen": "~0.16.2",
    "expo-status-bar": "~1.4.0",
    "expo-updates": "~0.14.6",
    "geofire-common": "^5.2.0",
    "lottie-ios": "3.2.3",
    "lottie-react-native": "5.1.3",
    "moment": "^2.29.1",
    "react": "18.0.0",
    "react-dom": "18.0.0",
    "react-error-boundary": "^3.1.4",
    "react-native": "0.69.6",
    "react-native-countdown-component": "^2.7.1",
    "react-native-elements": "^2.3.2",
    "react-native-exception-handler": "^2.10.10",
    "react-native-expo-fancy-alerts": "^2.1.0",
    "react-native-fbsdk-next": "^11.0.1",
    "react-native-gesture-handler": "~2.5.0",
    "react-native-maps": "0.31.1",
    "react-native-qrcode-svg": "^6.0.6",
    "react-native-reanimated": "~2.9.1",
    "react-native-safe-area-context": "4.3.1",
    "react-native-screens": "~3.15.0",
    "react-native-sha256": "^1.4.8",
    "react-native-simple-time-picker": "^1.3.11",
    "react-native-svg": "12.3.0",
    "react-native-swiper": "^1.6.0",
    "react-native-vector-icons": "^7.1.0",
    "react-native-web": "~0.18.7",
    "reactotron-react-native": "^5.0.0",
    "sentry-expo": "~5.0.0",
    "url": "^0.11.0",
    "use-interval": "^1.3.0"
  },
  "devDependencies": {
    "@babel/core": "^7.18.6",
    "babel-preset-expo": "~9.2.0"
  },
  "private": true,
  "name": "drops",
  "version": "1.0.0"
}

app.config.js for react-native-firebase v6:

{ name: nameApp, scheme: scheme, slug: "Drops", version: "1.0.58", orientation: "portrait", icon: iconApp, splash: { image: "./assets/DROPSverde.png", resizeMode: "contain", backgroundColor: "#242424" }, updates: { fallbackToCacheTimeout: 0 }, assetBundlePatterns: [ "**/*" ], plugins: [ ["sentry-expo"], [ "@react-native-firebase/app" ], ["./expoPlugins/withAndroidVerifiedLinksWorkaround"], [ "react-native-fbsdk-next", { "appID": Config.facebook.facebookAppId, "clientToken": Config.facebook.clientToken, "displayName": Config.facebook.displayName, "scheme": Config.facebook.facebookScheme, "advertiserIDCollectionEnabled": false, "autoLogAppEventsEnabled": false, "isAutoInitEnabled": true, "iosUserTrackingPermission": false } ] ], ios: { bundleIdentifier: domainAppIOS, supportsTablet: false, buildNumber: "1.0.58", googleServicesFile: Config.googleService.ios, associatedDomains: associatedDomains, config: { googleMapsApiKey: '' }, infoPlist: { "NSLocationAlwaysUsageDescription": "Esta app obtiene tu ubicación para mostrarte locales y beneficios cercanos a ti.", "NSLocationWhenInUseUsageDescription": "Esta app obtiene tu ubicación para mostrarte locales y beneficios cercanos a ti.", "NSCameraUsageDescription": "Esta app necesita acceso a la camara para poder escanear el código qr de los locales.", "NSPhotoLibraryAddUsageDescription": "Esta app necesita acceso a la galería de fotos para que los locales puedar subir fotos de sus beneficios.", "CFBundleShortVersionString": "1.0.58" } }, web: { favicon: "./assets/favicon.png" }, android: { package: domainAppAndroid, googleServicesFile: Config.googleService.android, versionCode: 121, config: { googleMaps: { apiKey: Config.maps.android } }, intentFilters: intentFilters, permissions: [ "CAMERA", "ACCESS_COARSE_LOCATION", "ACCESS_FINE_LOCATION", "NOTIFICATIONS", "USER_FACING_NOTIFICATIONS", "VIBRATE" ] }, extra: { ...Config, }, hooks: { postPublish: [ { file: "sentry-expo/upload-sourcemaps", config: { organization: "drops-prod", project: "react-native", authToken: "0ce614ab35fd47778a2d54da6547f690d0ce0dcc793141ecae11c219fdeeb290" } } ] } };


</details>

### iOS

<details><summary>Click To Expand</summary>
<p>

#### `ios/Podfile`:

- [ ] I'm not using Pods
- [x] I'm using Pods and my Podfile looks like:

```ruby
# 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:

expo-env-info 1.0.5 environment info:
    System:
      OS: macOS 12.3.1
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
      Yarn: 1.22.17 - /usr/local/bin/yarn
      npm: 8.19.2 - ~/.nvm/versions/node/v18.12.1/bin/npm
      Watchman: 2022.11.07.00 - /opt/homebrew/bin/watchman
    Managers:
      CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
    IDEs:
      Android Studio: 2021.1 AI-211.7628.21.2111.8193401
      Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
    npmPackages:
      babel-preset-expo: ~9.2.0 => 9.2.2 
      expo: ~46.0.16 => 46.0.17 
      react: 18.0.0 => 18.0.0 
      react-dom: 18.0.0 => 18.0.0 
      react-native: 0.69.6 => 0.69.6 
      react-native-web: ~0.18.7 => 0.18.10 
    npmGlobalPackages:
      eas-cli: 2.6.0
    Expo Workflow: managed

  • 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:
    • 16.5.0
  • Firebase module(s) you're using that has the issue:
    • auth
  • Are you using TypeScript?
    • no


franamu avatar Dec 20 '22 23:12 franamu

This is unexpected:

Xcode: 13.2.1

I was under the impression you needed at least Xcode 13.3 to build this currently 🤔 ? It's a minimum from firebase-ios-sdk

I haven't seen this personally though - has it ever been working for you and just broke (after some change / update)? Or has it never worked for you? This is a method that we test in our e2e tests, and it's in common usage in projects (including my own) so it's pretty surprising to see it fail.

mikehardy avatar Dec 21 '22 01:12 mikehardy

example of it working on the PR with the sdk bump that was merged + released as 16.5.0 - no problems https://github.com/invertase/react-native-firebase/actions/runs/3715151003/jobs/6299965259#step:22:255

🤔

mikehardy avatar Dec 21 '22 01:12 mikehardy

I'm going to have to close this without a https://stackoverflow.com/help/minimal-reproducible-example - all my searches indicate this is API misuse with regard to what is being sent as parameters, and the code snippet above is not complete + runnable.

As mentioned we test this API all the time and it works for the tests, myself, and others that use it so I suspect a project-specific problem. Can reopen if there's a reproducible example

mikehardy avatar Dec 21 '22 13:12 mikehardy