React-native-firebase: Force close when Remote JS Debugging

Created on 30 Oct 2017  路  7Comments  路  Source: invertase/react-native-firebase

Issue

Environment

  1. Application Target Platform: Android

  1. Development Operating System: Windows 7

  1. Build Tools:

  1. React Native version: 0.48.1

  1. RNFirebase Version: 3.0.5

  1. Firebase Module: Cloud Messaging

when Remote JS Debugging disable it's working. but when enable then force close apps.

React Native Waiting for User Response

Most helpful comment

@sirstevensu There are no errors in the log file relating to RNFirebase. The only errors relate to RNDeviceInfo and AirBnb's react native maps.

Also, you have not included a compile statement for react-native-firebase in your build.gradle so you're not even compiling our library.

I'm closing this as unrelated to RNFirebase. Please re-open if you find an error with our library specifically.

All 7 comments

@sirstevensu can you bring up android logging and check the output for an error stack, can't help much without knowing what the error is.

Thanks

@Salakar how to get logging android ? i can not running when Debug Js Remotly enable

android/build.gradle

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
        classpath 'com.google.gms:google-services:3.1.2'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
        maven {
            url 'https://maven.google.com'
        }
    }
}

android/app/build.gradle

dependencies {
    compile project(':react-native-fcm')
    compile project(':react-native-keep-awake')
    compile project(':react-native-svg')
    compile project(':react-native-sockets')
    //compile project(':react-native-mail')
  //  compile project(':SocketIo')
    compile project(':react-native-background-job')
    compile project(':react-native-fs')
    compile project(':react-native-file-provider')
    compile project(':RNMail')
    compile project(':react-native-vector-icons')
    compile project(':react-native-billing')
    compile project(':react-native-orientation')
    compile project(':react-native-maps')
    compile project(':react-native-image-picker')
    compile project(':react-native-html-to-pdf')
    compile project(':react-native-fetch-blob')
    compile project(':react-native-device-info')
    compile(project(':react-native-maps')){
        exclude group: 'com.google.android.gms', module: 'play-services-base'
        exclude group: 'com.google.android.gms', module: 'play-services-maps'
    }
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile 'com.google.firebase:firebase-core:11.4.2' //this decides your firebase SDK version
    compile "com.android.support:appcompat-v7:23.0.1"
    compile "com.facebook.react:react-native:+"  // From node_modules
    compile "com.google.android.gms:play-services-maps:11.4.2"
    compile "com.google.android.gms:play-services-base:11.4.2"

}

android/settings.graddle

rootProject.name = 'BOSSCompany'
include ':react-native-firebase'
project(':react-native-firebase').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase/android')
include ':react-native-keep-awake'
    project(':react-native-keep-awake').projectDir = new File(rootProject.projectDir,   '../node_modules/react-native-keep-awake/android')
include ':react-native-svg'
project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-svg/android')
include ':react-native-sockets'
project(':react-native-sockets').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-sockets/android')

AndroidManifest.xml

<service android:name="com.evollu.react.fcm.MessagingService" android:enabled="true" android:exported="true">
        <intent-filter>
          <action android:name="com.google.firebase.MESSAGING_EVENT"/>
        </intent-filter>
      </service>
<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@mipmap/ic_launcher"/>
      <receiver android:name="com.evollu.react.fcm.FIRLocalMessagingPublisher"/>
      <receiver android:enabled="true" android:exported="true"  android:name="com.evollu.react.fcm.FIRSystemBootEventReceiver">
          <intent-filter>
              <action android:name="android.intent.action.BOOT_COMPLETED"/>
              <action android:name="android.intent.action.QUICKBOOT_POWERON"/>
              <action android:name="com.htc.intent.action.QUICKBOOT_POWERON"/>
              <category android:name="android.intent.category.DEFAULT" />
          </intent-filter>
      </receiver>


      <service android:name="com.evollu.react.fcm.InstanceIdService" android:exported="false">
        <intent-filter>
          <action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
        </intent-filter>
      </service>

MainApllication.java

protected List<ReactPackage> getPackages() { return Arrays.<ReactPackage>asList( new MainReactPackage(), new RNFirebasePackage(), new RNFirebaseMessagingPackage(), new SvgPackage(), new SocketsPackage(), // new RNMail(), // new SocketIoPackage(), new BackgroundJobPackage(), new RNFSPackage(), new RNFileProviderPackage(), new VectorIconsPackage(), new RNHTMLtoPDFPackage(), new RNFetchBlobPackage(), new InAppBillingBridgePackage(), new OrientationPackage(), new MapsPackage(), new ImagePickerPackage(), new RNDeviceInfo(), new RNMail(), new KCKeepAwakePackage() ); }

@sirstevensu If the device is connected to your PC then you can run adb logcat from the command line to get access to the Android device logs

+1

@Salakar log.txt

@sirstevensu There are no errors in the log file relating to RNFirebase. The only errors relate to RNDeviceInfo and AirBnb's react native maps.

Also, you have not included a compile statement for react-native-firebase in your build.gradle so you're not even compiling our library.

I'm closing this as unrelated to RNFirebase. Please re-open if you find an error with our library specifically.

Was this page helpful?
0 / 5 - 0 ratings