[android] Crash when event has alarms
See original GitHub issueCrash on: Sony Xperia XZ1 Sony Xperia XZ2 Xiaomi Mi A2 Lite Xiaomi Mi A1 ONEPLUS A6000 OnePlus5 OnePlus3T Google Pixel XL LG Nexus 5X (Android 8)
Environment
React Native Environment Info:
System:
OS: macOS 10.15.2
CPU: (8) x64 Intel(R) Core(TM) i7-3740QM CPU @ 2.70GHz
Memory: 95.02 MB / 16.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 13.5.0 - /usr/local/bin/node
Yarn: 1.21.1 - /usr/local/bin/yarn
npm: 6.13.4 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
Android SDK:
API Levels: 25, 26, 27, 28
Build Tools: 23.0.1, 23.0.2, 23.0.3, 24.0.2, 25.0.0, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.2, 28.0.3, 29.0.2
System Images: android-27 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.6010548
Xcode: 11.2.1/11B500 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.59.10 => 0.59.10
npmGlobalPackages:
create-react-native-app: 0.0.6
react-native-cli: 2.0.1
react-native-create-library: 1.0.1
react-native-git-upgrade: 0.2.7
react-native-rename: 2.1.2
Steps to Reproduce
save event with alarms:
alarms: [
{
date: 90,
},
]
Expected Behavior
event is saved
Actual Behavior
Crash
2020-02-20 13:35:01.267 28972-29347/com.busfor.Busfor.staging E/AndroidRuntime: FATAL EXCEPTION: Thread-19
Process: com.busfor.Busfor.staging, PID: 28972
android.database.sqlite.SQLiteException
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:179)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
at android.content.ContentProviderProxy.insert(ContentProviderNative.java:476)
at android.content.ContentResolver.insert(ContentResolver.java:1539)
at com.calendarevents.CalendarEvents.createRemindersForEvent(CalendarEvents.java:825)
at com.calendarevents.CalendarEvents.addEvent(CalendarEvents.java:663)
at com.calendarevents.CalendarEvents.access$200(CalendarEvents.java:44)
at com.calendarevents.CalendarEvents$3.run(CalendarEvents.java:1225)
at java.lang.Thread.run(Thread.java:764)
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
Detect and diagnose crashes - Android Developers
An Android app crashes whenever there's an unexpected exit caused by an unhandled exception or signal. An app that is written using Java...
Read more >Android app crash behavior - CommonsWare
Problem occurs when app crashes, the service destroys, alarms don't fire anymore. I can smell that my process is killed that is why...
Read more >How to Diagnose App Issues Using Crash Logs - Papertrail
To switch to Logcat view on Android Studio, click on the Logcat label in the bottom tool window. Below is the report from...
Read more >Android: App crashes during touch event in AndroidPlot
However anytime a touch event occurs, on the emulator and on the actual phone. Here is the code for the graph page: public...
Read more >Crash on Samsung devices from AlarmManager #230 - GitHub
2 of our beta testers have reported this crash, one using a Samsung Galaxy S8, and the other using a Samsung Galaxy Note8,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just adding to this thread here: We don’t experience crashes, but we do have difficulties with alarms on calendar events on Android. They work fine on iOS, but seem to be missing on Android. Is at least what I thought until I looked at the same event in the Google Calendar web app where I saw that an alarm was indeed associated with the event, but didn’t show up in the Google Calendar Android app.
Just putting this info out here in case that it helps understanding the issue for whoever might tackle it.
EDIT: If you use a negative number for
alarms
on Android and a positive on iOS it seems to fix the issue