OneSignal-Android-SDK icon indicating copy to clipboard operation
OneSignal-Android-SDK copied to clipboard

Invalid BigInteger

Open Goichi100 opened this issue 7 years ago • 7 comments

Description: Hi, Haven't been working on my app since a few weeks. Today my app keeps crashing from start. It worked fine few weeks ago.

Environment

  1. Android SDK 28
  2. Onesignal latest (3.10.7)
  3. Maven added as described in documentation
  4. Tried cradle 0.11.0 and latest 0.12.1

Steps to Reproduce Issue:

  1. With OneSignal.startInit(this)... app keeps crashing from start
  2. Without OneSignal.startInit(this)... app stays alive and everything works fine (except receiving push notifications)

Anything else:

Error trace: E/AndroidRuntime: FATAL EXCEPTION: Thread-8 java.lang.NumberFormatException: Invalid BigInteger: #FF0000 at java.math.BigInt.invalidBigInteger(BigInt.java:86) at java.math.BigInt.checkString(BigInt.java:140) at java.math.BigInt.putHexString(BigInt.java:99) at java.math.BigInteger.<init>(BigInteger.java:244) at com.onesignal.NotificationChannelManager.createChannel(NotificationChannelManager.java:133) at com.onesignal.NotificationChannelManager.processChannelList(NotificationChannelManager.java:204) at com.onesignal.OneSignal$4.complete(OneSignal.java:855) at com.onesignal.OneSignalRemoteParams.processJson(OneSignalRemoteParams.java:92) at com.onesignal.OneSignalRemoteParams.access$100(OneSignalRemoteParams.java:11) at com.onesignal.OneSignalRemoteParams$1.onSuccess(OneSignalRemoteParams.java:58) at com.onesignal.OneSignalRestClient$5.run(OneSignalRestClient.java:253) at java.lang.Thread.run(Thread.java:764)

Goichi100 avatar Apr 04 '19 21:04 Goichi100

@Goichi100 Thanks for reporting. From reviewing the stack trace it seems the Led color you have setup in your Notification Categories on the OneSignal dashboard was the incorrect format.

We will look into adding both a catch here and validation on the dashboard to prevent this error.

In the meantime I recommend doubling check the color value on each of the notification Categories.

jkasten2 avatar Apr 10 '19 01:04 jkasten2

@jkasten2 Thanks! That was the probleem, didn't realize I had to look over there. Now the app is working like a charm again.

Goichi100 avatar Apr 10 '19 10:04 Goichi100

Having same issue for android version 8 and above.

Please help.

avi-nitb avatar Apr 11 '19 07:04 avi-nitb

It's done. It was helpful. Thanks team

avi-nitb avatar Apr 11 '19 07:04 avi-nitb

Guys, having same issue here, I believe it would be better to validate when user is inputing color in your site, and in the lib handle the error as a warning, not firing the exception to the user

jpirovano avatar Apr 14 '19 17:04 jpirovano

This issue has been fixed and will be in the next release

rgomezp avatar Jun 12 '19 02:06 rgomezp

I found that such error and crash happens (using react-native-onesigna 3.2.14), when creating a category that contains custom notification color which starts with # sign such as #30D2FFFF Just change it to 30D2FFFF and the issue will be resolved

Guess OneSignal should edit the placeholder of this field and remove # sign

Screen Shot 2019-07-15 at 11 14 35 PM

MujtabaFR avatar Jul 15 '19 20:07 MujtabaFR