Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashing on Android #152

Open
julestruong opened this issue Feb 14, 2022 · 5 comments
Open

Crashing on Android #152

julestruong opened this issue Feb 14, 2022 · 5 comments

Comments

@julestruong
Copy link

julestruong commented Feb 14, 2022

When calling

  try {
      const eventConfig: AddCalendarEvent.CreateOptions = {
        title: 'test',
        startDate: dayjs().startOf('hour').toISOString(),
        endDate: dayjs().startOf('hour').add(1, 'hour').toISOString(),
        location: 'Rayon',
        // and other options
      }
      const result = await AddCalendarEvent.presentEventCreatingDialog(
        eventConfig,
      )
      if (result.action === 'SAVED') {
        const { calendarItemIdentifier, eventIdentifier } = result

        console.log(calendarItemIdentifier, eventIdentifier)
      } else {
        console.log('Canceled')
      }
    } catch (error) {
      console.log('WHAT')
      console.log(error)
    }

The error :

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.android.calendar/com.android.calendar.event.EditEventActivity}: java.lang.ClassNotFoundException: Didn't find class "com.android.calendar.event.EditEventActivity" on path: DexPathList[[zip file "/product/app/Calendar/Calendar.apk"],nativeLibraryDirectories=[/product/app/Calendar/lib/x86, /system/lib, /system_ext/lib]]
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3365)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:223)
        at android.app.ActivityThread.main(ActivityThread.java:7656)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

Version "react-native-add-calendar-event": "4.0.0",
Simulator : Pixel 5

@catcher23
Copy link

catcher23 commented Mar 9, 2022

running into the same issue. @julestruong did you find a way to resolve this? @vonovak any ideas?

@grkemtneri
Copy link

did you find any solution ? @catcher23

@gamertense
Copy link

gamertense commented Apr 3, 2024

Can you try setting the library to v4.2.2? It works for me both on iOS and Android if I stick with this version.

The app crashes when I use v5.0.0. I didn't check native console, but I think it's the same root cause.

@makedirectory
Copy link

Can you try setting the library to v4.2.2? It works for me both on iOS and Android if I stick with this version.

The app crashes when I use v5.0.0. I didn't check native console, but I think it's the same root cause.

Only works here when set to v4.2.2 on Android.

@ehteshamtrimulabs
Copy link

On the latest version, you need to ask for both read and write permissions for calendar.

#185 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants