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

Application crashes when notification receive in background

Open yasir-systemplus opened this issue 4 years ago • 6 comments

Description

Hi Folks!

I have been facing this issue for very long time. When notification is received in background, application crashes. We are using Rn FIrebase FCM

App only crashes in quit state. It works fine in background and foreground. I am attaching the log from Crashlytics of firebase.

Fatal Exception: com.facebook.react.common.JavascriptException
TypeError: Cannot read property 'insets' of null, js engine: hermes, stack: anonymous@1:1364715 loadModuleImplementation@1:80203 guardedLoadModule@1:79751 metroRequire@1:79379 anonymous@1:1362660 loadModuleImplementation@1:80203 guardedLoadModule@1:79751 metroRequire@1:79379 anonymous@1:600754 loadModuleImplementation@1:80203 guardedLoadModule@1:79751 metroRequire@1:79379 anonymous@1:86756 loadModuleImplementation@1:80203 guardedLoadModule@1:79708 metroRequire@1:79379 global@1:78965

Version

0.67.2

Output of npx react-native info

System: OS: Windows 10 10.0.22000 CPU: (12) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz Memory: 1.97 GB / 15.84 GB Binaries: Node: 16.13.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD npm: 8.1.0 - C:\Program Files\nodejs\npm.CMD Watchman: Not Found SDKs: Android SDK: API Levels: 29, 30, 32 Build Tools: 30.0.2, 30.0.3, 32.0.0, 32.1.0 System Images: android-30 | Google Play Intel x86 Atom Android NDK: Not Found Windows SDK: Not Found IDEs: Android Studio: Not Found Visual Studio: Not Found Languages: Java: Not Found npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.67.2 => 0.67.2 react-native-windows: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

  1. Quit app from minimized tray.
  2. Receive notification in quit state.
  3. Tap or receive more notifications.

Application crashes.

Snack, code example, screenshot, or link to a repository

Screenshot_2

https://user-images.githubusercontent.com/88422920/154014406-c919e646-c7bb-4998-81ec-674906c979c7.mp4

yasir-systemplus avatar Feb 15 '22 07:02 yasir-systemplus

image

I faced the same issue. then I tried removing the above line from my android/app/src/main/AndroidManifest.xml file and it worked without any issues

gokul1099 avatar Feb 23 '22 13:02 gokul1099

image

I faced the same issue. then I tried removing the above line from my android/app/src/main/AndroidManifest.xml file and it worked without any issues

I dont use this line inside AndroidManifest.xml

Here is AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package=XXXXXX">
  <uses-permission android:name="android.permission.INTERNET" />
  <!-- <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> -->
  <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
   <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
   <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
   <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  <application 
  android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="false" android:theme="@style/AppTheme">
     <meta-data
     android:name="com.google.android.geo.API_KEY"
     android:value="XXXXXXX"/>
   <!-- You will also only need to add this uses-library tag -->
   <uses-library android:name="org.apache.http.legacy" android:required="false"/>
    <activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustPan" android:screenOrientation="portrait">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
        <action android:name="android.intent.action.DOWNLOAD_COMPLETE"/>
      </intent-filter>
    </activity>
  </application>
</manifest>

yasir-systemplus avatar Feb 23 '22 13:02 yasir-systemplus

There will be two AndroidManifest.xml one will be in android/app/src/main and another in android/app/src/debug. have you checked both. for me it was in main

gokul1099 avatar Feb 23 '22 14:02 gokul1099

There will be two AndroidManifest.xml one will be in android/app/src/main and another in android/app/src/debug. have you checked both. for me it was in main

Yes, I have checked. There was nothing relevant to firebase services.

yasir-systemplus avatar Feb 24 '22 11:02 yasir-systemplus

Anybody have any idea about it?

yasir-systemplus avatar Apr 01 '22 12:04 yasir-systemplus

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Oct 18 '22 02:10 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar Oct 25 '22 02:10 github-actions[bot]