Android Calendar Crashes java.lang.NumberFormatException

Hello, Ive been using the Calendar API for some time now. But recently I noticed some crashes in my app.

Im sure I have permissions to use calendars.
This is my import import {Calendar as NativeCalendar, Permissions} from "expo";

And this is what i use to make sure I have permissions

    askForCalendarPermissions = async () => {
        const calendarPermissions = await Permissions.askAsync(Permissions.CALENDAR);

        return calendarPermissions.status === 'granted';

The crash occurs when i call:
const eventCalendars = await NativeCalendar.getCalendarsAsync(NativeCalendar.EntityTypes.EVENT);

I get no bug report from XDE but in Google Play Console I get this error (on multiple devices)
It has occurred on Android 8.0 and Android 7.0

  at java.lang.Integer.parseInt (
  at java.lang.Integer.parseInt (
  at (
  at (
  at (
  at (
  at$000 (
  at$ (
  at android.os.AsyncTask$SerialExecutor$ (
  at java.util.concurrent.ThreadPoolExecutor.runWorker (
  at java.util.concurrent.ThreadPoolExecutor$ (
  at (

Please fix this bug!


I made a Snack that is basically your code.
It seems to work on my Android phone.

Does this work for you?

Nope It crashes.

Whats wierd is that i got promted twice about permissons. Its the same in my app.
Maybe its unrelated but still weird.

Im also aware that this bug doesn’t affect all android devices, since Ive tried it on multiple devices.

What device do you have? It sounds like a bug.
Can you file a Github issue here?

Here is the github issue for reference

Thanks for filing an issue! It’s much appreciated.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.