Crash getCalendarsAsync


#1

Hello!
Two users reported problem opening my app (Android 7.1 and 8.0), I identified it’s on the calendar.
I found the errors in Google Play / Failures.

Google Play Console:

java.lang.NumberFormatException:
at java.lang.Integer.parseInt (Integer.java:620)
at java.lang.Integer.parseInt (Integer.java:643)
at versioned.host.exp.exponent.modules.api.CalendarModule.calendarAllowedAttendeeTypesFromDBString (CalendarModule.java:1147)
at versioned.host.exp.exponent.modules.api.CalendarModule.serializeEventCalendar (CalendarModule.java:1353)
at versioned.host.exp.exponent.modules.api.CalendarModule.serializeEventCalendars (CalendarModule.java:1332)
at versioned.host.exp.exponent.modules.api.CalendarModule.findCalendars (CalendarModule.java:318)
at versioned.host.exp.exponent.modules.api.CalendarModule.access$000 (CalendarModule.java:41)
at versioned.host.exp.exponent.modules.api.CalendarModule$1.run (CalendarModule.java:70)
at android.os.AsyncTask$SerialExecutor$1.run (AsyncTask.java:245)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:636)
at java.lang.Thread.run (Thread.java:764)

Code:

export async function getCalendar(){

try {

  let permission     = await reqPermission(Permissions.CALENDAR);
  let permission_IOS = await reqPermission(Permissions.REMINDERS);

  if( (permission == true) && (permission_IOS == true) )
  {
    let account = await Calendar.getCalendarsAsync(Calendar.EntityTypes.EVENT);
    CONFIG_GERAL.accounts = account;  
    return account

  }
  else
    return null  

} catch(error){

CONFIG_GERAL.accounts = [];  
return null

}

}

Package.json:
{
“main”: “node_modules/expo/AppEntry.js”,
“private”: true,
“scripts”: {
“start”: “react-native-scripts start”,
“eject”: “react-native-scripts eject”,
“android”: “react-native-scripts android”,
“ios”: “react-native-scripts ios”,
“test”: “node ./node_modules/jest/bin/jest.js --watchAll”
},
“jest”: {
“preset”: “jest-expo”
},
“dependencies”: {
“base-64”: “^0.1.0”,
“base64-js”: “^1.3.0”,
“crypto-js”: “^3.1.9-1”,
“exp”: “^57.2.1”,
“expo”: “^31.0.0”,
“expo-cli”: “^2.2.6”,
“expo-server-sdk”: “^3.0.1”,
“moment”: “^2.22.2”,
“native-base”: “^2.7.1”,
“react”: “16.5.0”,
“react-native”: “https://github.com/expo/react-native/archive/sdk-31.0.1.tar.gz”,
“react-native-action-button”: “^2.8.4”,
“react-native-actionsheet”: “^2.4.2”,
“react-native-cli”: “^2.0.1”,
“react-native-color-palette”: “^2.0.1”,
“react-native-datepicker”: “^1.7.2”,
“react-native-device-info-2”: “^0.1.1”,
“react-native-elements”: “^0.19.1”,
“react-native-keyboard-aware-scroll-view”: “^0.7.2”,
“react-native-maps”: “^0.22.0”,
“react-native-masked-text”: “^1.7.2”,
“react-native-material-textfield”: “^0.12.0”,
“react-native-router-flux”: “^4.0.0-beta.40”,
“react-native-scripts”: “^1.14.0”,
“react-native-select-multiple”: “^1.2.0”,
“react-native-vector-icons”: “^4.6.0”,
“react-navigation”: “^2.18.2”,
“react-timer-mixin”: “^0.13.4”,
“rn-pdf-reader-js”: “^0.1.7”,
“sort-by-distance”: “^1.0.1”
},
“devDependencies”: {
“jest-expo”: “^31.0.0”,
“sentry-expo”: “~1.9.0”
}
}

Thank you


#2

Hey @programacaotwt,

This sounds like it’s a bug. Would you mind creating a Snack with the relevant code and then creating an issue here: https://github.com/expo/expo/issues with all the relevant information and the Snack so we can attempt to reproduce and debug the issue on our end?

Cheers,

Adam


#3

Good evening @adamjnav, these errors happened with two users that I do not have access to, I can not reproduce the error.

The errors occur in a Moto X (4) (payton) and Moto X Play (lux_uds)

If anyone has these templates and help with the test, thank you.


#4

Hey @adamjnav,

Could you let me know if there is a test area at the expo?
I created a snack, simulating the error of access to the calendar, but only happens in Android and Moto X and Moto X Play.

Will it be if someone could help me in the tests?

Thank you.


closed #5

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