Invalid BigInteger
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
- Android SDK 28
- Onesignal latest (3.10.7)
- Maven added as described in documentation
- Tried cradle 0.11.0 and latest 0.12.1
Steps to Reproduce Issue:
- With OneSignal.startInit(this)... app keeps crashing from start
- 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 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 Thanks! That was the probleem, didn't realize I had to look over there. Now the app is working like a charm again.
Having same issue for android version 8 and above.
Please help.
It's done. It was helpful. Thanks team
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
This issue has been fixed and will be in the next release
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
