Skip to content
This repository has been archived by the owner on Jan 14, 2025. It is now read-only.

Fatal Exception: java.lang.NullPointerException #1641

Closed
SergiOnGit opened this issue Sep 13, 2020 · 12 comments
Closed

Fatal Exception: java.lang.NullPointerException #1641

SergiOnGit opened this issue Sep 13, 2020 · 12 comments

Comments

@SergiOnGit
Copy link

Bug

App crashes and closing. Firebase crashlitycs catches this error "Attempt to invoke virtual method 'double java.lang.Double.doubleValue()' on a null object reference"

Environment info

react-native info output:

 System:
    OS: Windows 10 10.0.18363
    CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
    Memory: 4.93 GB / 15.89 GB
  Binaries:
    Node: 10.19.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.21.1 - C:\Users\Warlock\AppData\Roaming\npm\yarn.CMD
    npm: 6.13.4 - C:\Program Files\nodejs\npm.CMD
    Watchman: Not Found
  SDKs:
    Android SDK:
      API Levels: 23, 25, 27, 28, 29
      Build Tools: 19.1.0, 20.0.0, 21.1.2, 22.0.1, 23.0.1, 23.0.2, 23.0.3, 24.0.0, 24.0.1, 24.0.2, 24.0.3, 25.0.0, 25.0.1, 25.0.2, 25.0.3, 26.0.0, 26.0.1, 26.0.2, 26.0.3, 27.0.0, 27.0.1, 27.0.2, 27.0.3, 28.0.0, 28.0.1, 28.0.2, 28.0.3, 29.0.0, 29.0.1, 29.0.2, 29.0.3, 30.0.0, 30.0.1, 30.0.2
      System Images: android-28 | Google Play Intel x86 Atom, android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: Version  4.0.0.0 AI-193.6911.18.40.6626763
  Languages:
    Java: 1.8.0_231
    Python: 2.7.17
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1
    react-native: 0.63.2 => 0.63.2
  npmGlobalPackages:
    *react-native*: Not Found

Library version: 5.1.0

Steps To Reproduce

Reproducible sample code

Here is my code:

I am canceling notification and then register.

PushNotification.cancelLocalNotifications({ id: '090000', });

PushNotification.localNotificationSchedule({
            id: '090000',
            message: 'test',
            date: morningDate,
            repeatType: 'day',
            allowWhileIdle: true,
            autoCancel: true,
            ignoreInForeground: true,
});

Doesn't crash anywhere, only some devices or maybe randomly cause it happens on every model and every android version.

@Dallas62
Copy link
Collaborator

Hi @SergiOnGit
Can you provide the full stacktrace ?
Actually the mentioned method is not used in the project.
https://github.com/zo0r/react-native-push-notification/search?q=doubleValue&unscoped_q=doubleValue

@kabus202
Copy link

kabus202 commented Sep 14, 2020

I'm doing the same, and i have exactly the same problem

UPDATE2: @SergiOnGit downgrade to 4.0.0 solves the issue for me

error

@Dallas62
Copy link
Collaborator

Hi @kabus202
Thanks for the stacktrace, I'm on it.

@Dallas62
Copy link
Collaborator

Can you try the version on master ?

@Dallas62 Dallas62 reopened this Sep 14, 2020
@SergiOnGit
Copy link
Author

Hello @Dallas62

Thanks for fast response. Latest version on master is 5.1.0 and i already have it. So what do you mean?

@Dallas62
Copy link
Collaborator

If you are able to reproduce it, you can test:

npm install zo0r/react-native-push-notification#master

OR

yarn add zo0r/react-native-push-notification#master

@SergiOnGit
Copy link
Author

I got this. Give me one day to test it.

@kabus202
Copy link

yes, i will test this also today (afternoon)

@SergiOnGit
Copy link
Author

I have updated my app in production yesterday and firebase doesn't see any error in new version. So i think it is solved. @kabus202 What about you?

@kabus202
Copy link

hello guys, i don't see any errors, i think it's fixed @SergiOnGit
@Dallas62 thanks for the quick fix, really appreciate it.

@Dallas62
Copy link
Collaborator

Hi,
Thanks for feedbacks!
I will release the fix at the end of the day. As a fix-version (5.1.1).
Regards

@SergiOnGit
Copy link
Author

SergiOnGit commented Sep 15, 2020

Thank you @Dallas62

Dallas62 added a commit that referenced this issue Sep 26, 2020
* master:
  Upgrade to 5.1.1.
  Fix #1641
  Add explanation to DO NOT USE `.configure()` INSIDE A COMPONENT, EVEN `App`

# Conflicts:
#	CHANGELOG.md
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants