:fire:
## Issue
Getting the following crash when querying via Firestore on… Android:
```
FATAL EXCEPTION: mqt_native_modules
E Process: com.myapp.mobile, PID: 18809
E com.facebook.react.bridge.NativeArgumentsParseException: RNFirebaseFirestore.collectionGet got 7 arguments, expected 8
E at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:355)
E at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:162)
E at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
E at android.os.Handler.handleCallback(Handler.java:873)
E at android.os.Handler.dispatchMessage(Handler.java:99)
E at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
E at android.os.Looper.loop(Looper.java:193)
E at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:194)
E at java.lang.Thread.run(Thread.java:764)
```
---
## Project Files
### Android
#### `android/build.gradle`:
```groovy
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:4.0.1'
classpath 'io.fabric.tools:gradle:1.25.4'
}
}
allprojects {
repositories {
mavenLocal()
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
google()
}
}
```
#### `android/app/build.gradle`:
```groovy
android {
compileSdkVersion 28
buildToolsVersion "23.0.1"
defaultConfig {
applicationId ""
minSdkVersion 16
targetSdkVersion 26
multiDexEnabled true
versionCode 5
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
}
dependencies {
compile project(':react-native-vector-icons')
compile project(':react-native-svg')
compile project(':react-native-share')
compile(project(':react-native-firebase')) {
transitive = false
}
compile project(':react-native-fbsdk')
compile project(':react-native-share')
compile project(':react-native-vector-icons')
compile project(':react-native-svg')
compile(project(':react-native-firebase')) {
transitive = false
}
compile project(':react-native-vector-icons')
compile project(':react-native-vector-icons')
compile(project(':react-native-firebase')) {
transitive = false
}
implementation 'com.android.support:multidex:1.0.3'
implementation project(':react-native-vector-icons')
implementation(project(':react-native-firebase')) {
transitive = false
}
implementation project(':react-native-firebase')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation("com.android.support:appcompat-v7:28.0.0")
implementation("com.android.support:support-fragment:28.0.0")
implementation("com.android.support:support-core-utils:28.0.0")
implementation("com.android.support:support-core-utils:28.0.0")
implementation("com.android.support:animated-vector-drawable:28.0.0")
implementation("com.android.support:support-vector-drawable:28.0.0")
implementation("com.android.support:support-core-ui:28.0.0")
implementation("com.android.support:support-compat:28.0.0")
implementation("com.android.support:support-annotations:28.0.0")
implementation("android.arch.lifecycle:runtime:1.1.1")
implementation("android.arch.lifecycle:common:1.1.1")
implementation("android.arch.core:common:1.1.1")
implementation "com.facebook.react:react-native:+" // From node_modules
implementation('com.crashlytics.sdk.android:crashlytics:2.9.5@aar') {
transitive = true
}
// Firebase dependencies
implementation "com.google.android.gms:play-services-base:16.0.1"
implementation "com.google.firebase:firebase-core:16.0.4"
implementation "com.google.firebase:firebase-auth:16.0.5"
implementation 'com.google.firebase:firebase-perf:16.2.0'
implementation "com.google.firebase:firebase-firestore:17.1.2"
implementation "com.google.firebase:firebase-messaging:17.3.4"
}
```
#### `android/settings.gradle`:
```groovy
rootProject.name = 'reprintmobile'
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-svg'
project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-svg/android')
include ':react-native-share'
project(':react-native-share').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-share/android')
include ':react-native-firebase'
project(':react-native-firebase').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase/android')
include ':react-native-fbsdk'
project(':react-native-fbsdk').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fbsdk/android')
include ':react-native-share'
project(':react-native-share').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-share/android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-svg'
project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-svg/android')
include ':react-native-firebase'
project(':react-native-firebase').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase/android')
include ':react-native-fbsdk'
project(':react-native-fbsdk').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fbsdk/android')
include ':react-native-fbsdk'
project(':react-native-fbsdk').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fbsdk/android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-firebase'
project(':react-native-firebase').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase/android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-firebase'
project(':react-native-firebase').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase/android')
include ':react-native-firebase'
project(':react-native-firebase').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase/android')
include ':app'
```
#### `MainApplication.java`:
```java
package com.app.mobile;
import android.app.Application;
import com.oblador.vectoricons.VectorIconsPackage;
import io.invertase.firebase.RNFirebasePackage;
import io.invertase.firebase.auth.RNFirebaseAuthPackage;
import io.invertase.firebase.analytics.RNFirebaseAnalyticsPackage;
import io.invertase.firebase.firestore.RNFirebaseFirestorePackage;
import io.invertase.firebase.messaging.RNFirebaseMessagingPackage;
import io.invertase.firebase.notifications.RNFirebaseNotificationsPackage;
import io.invertase.firebase.fabric.crashlytics.RNFirebaseCrashlyticsPackage;
import com.facebook.CallbackManager;
import com.facebook.react.ReactApplication;
import com.oblador.vectoricons.VectorIconsPackage;
import com.horcrux.svg.SvgPackage;
import cl.json.RNSharePackage;
import io.invertase.firebase.RNFirebasePackage;
import com.facebook.reactnative.androidsdk.FBSDKPackage;
import cl.json.RNSharePackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.horcrux.svg.SvgPackage;
import io.invertase.firebase.RNFirebasePackage;
import com.facebook.reactnative.androidsdk.FBSDKPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import java.util.Arrays;
import java.util.List;
import com.app.mobile.BuildConfig;
public class MainApplication extends Application implements ReactApplication {
public CallbackManager mCallbackManager;
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
mCallbackManager = new CallbackManager.Factory().create();
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new VectorIconsPackage(),
new SvgPackage(),
new RNSharePackage(),
new FBSDKPackage(mCallbackManager),
new RNFirebasePackage(),
new RNFirebaseAuthPackage(),
new RNFirebaseAnalyticsPackage(),
new RNFirebaseMessagingPackage(),
new RNFirebaseNotificationsPackage(),
new RNFirebaseCrashlyticsPackage(),
new RNFirebaseFirestorePackage()
);
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
}
}
```
---
## Environment
- **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
- **If known, the version of the platform are you experiencing the issue on:**
- `Android P`
- **Operating System:**
- [ ] MacOS, version: `N/A`
- [ ] Windows, version: `N/A`
- [ ] Other, please specify: `N/A`
- **Build Tools:**
- `Android Studio 3.2`
- **`React Native` version:**
- `0.54.4`
- **`React Native Firebase` library version:**
- `5.1.0`
- **`Firebase` module(s) you're using that has the issue:**
- [ ] Authentication
- [ ] Analytics
- [x] Cloud **Firestore**
- [ ] Cloud **Messaging** (FCM)
- [ ] Crashlytics
- [ ] Dynamic **Links**
- [ ] **Functions** Callable
- [ ] Invites
- [ ] Instance ID
- [ ] Notifications
- [ ] Performance Monitoring
- [ ] Realtime **Database**
- [ ] Remote **Config**
- [ ] Storage
- **Are you using `TypeScript`?**
- [x] No
- [ ] Yes, version: `N/A`
- **Are you using Expo, e.g. `ExpoKit`?**
- [x] No
- [ ] Yes, I've _not_ ejected
- [ ] Yes, but I **have** ejected to `ExpoKit`
- [ ] Yes, but I **have** ejected to vanilla React Native
- Expo version: `N/A`
---
Think `react-native-firebase` is great? Please consider supporting the project with any of the below:
- 👉 Donate via [Open Collective](https://opencollective.com/react-native-firebase/donate)
- 👉 Follow [`React Native Firebase`](https://twitter.com/rnfirebase) and [`Invertase`](https://twitter.com/invertaseio) on Twitter
- 👉 Star this repo on GitHub ⭐️
- 👉 Contribute; see our [contributing guide](./../../CONTRIBUTING.md)