question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

App crashes using save event on android

See original GitHub issue

using the method saveEvent close the application, I have a notificationService wrapping the saveEvent method and passing a date with the format YYYY-mm-DD crashed the application

Environment

System: OS: macOS 10.15.7 CPU: (4) x64 Intel® Core™ i5-7267U CPU @ 3.10GHz Memory: 442.09 MB / 8.00 GB Shell: 5.7.1 - /bin/zsh Binaries: Node: 14.3.0 - ~/.nvm/versions/node/v14.3.0/bin/node Yarn: 1.22.4 - ~/.nvm/versions/node/v14.3.0/bin/yarn npm: 6.14.5 - ~/.nvm/versions/node/v14.3.0/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Managers: CocoaPods: 1.10.1 - /usr/local/bin/pod SDKs: iOS SDK: Not Found Android SDK: API Levels: 28, 29 Build Tools: 28.0.3, 29.0.2, 29.0.3 System Images: android-28 | Google Play Intel x86 Atom Android NDK: Not Found IDEs: Android Studio: 3.6 AI-192.7142.36.36.6392135 Xcode: /undefined - /usr/bin/xcodebuild Languages: Java: 1.8.0_275 - /usr/bin/javac Python: 3.8.5 - /opt/anaconda3/bin/python npmPackages: @react-native-community/cli: Not Found react: 16.13.1 => 16.13.1 react-native: 0.63.4 => 0.63.4 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Steps to Reproduce

const createEvent = async () => {
    var startDateUTC =  '2021-01-31T14:00:00.000Z';
    const event = {
      title: 'my first event',
      startDate: moment(startDateUTC).subtract(1, 'hours').toISOString(),
      endDate: moment(startDateUTC).toISOString(),
    };
    const calendar = calendars.pop();
    console.log(calendar);
    const result = await calendarService.addCalendarEvent(event, calendar);
  }
  return (
    <>
      <Appbar>
        <Appbar.Action
          icon="archive"
          onPress={() => console.log('Pressed archive')}
        />
        <Appbar.Action icon="mail" onPress={() => console.log('Pressed mail')} />
        <Appbar.Action icon="label" onPress={async () => await createEvent()} />
        <Appbar.Action
          icon="delete"
          onPress={() => notificationService.scheduleNotification({ title: "hello", message: "its me andy", date: new Date(Date.now() + 60 * 1000) })}
        />
      </Appbar>
      <ProcessPage />
    </>
  );

Expected Behavior

should save the event

Actual Behavior

the app crash and is forced to stop

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:10

github_iconTop GitHub Comments

2reactions
MoOxcommented, Feb 1, 2021

Can you try passing timestamp instead of ISOstring for dates?

1reaction
deflexablecommented, Mar 25, 2022

removing the attendees property and making the id integer string stops the crashing for me

Read more comments on GitHub >

github_iconTop 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 >
Unexpected App Crashes on Android and How to Deal with ...
Solution 1: · Save your PID in a bundle by overriding 'onSaveInstanceState' function. · In the 'onCreate' method, compare the current PID and...
Read more >
Android Event Listener's initialize crashes app - Stack Overflow
Try this.. Declear your setContentView(R.layout.activity_login); below super.onCreate before initializing any button , textview , etc.,
Read more >
App Center Crashes for Android - Microsoft Learn
This method must only be used after Crashes has been started, it will always return false before start. Note. In some cases, a...
Read more >
How to fix apps keep crashing and freezing - Samsung
This usually occurs when your Wi-Fi or cellular data is slow or unstable, and apps tend to malfunction. Another reason for Android apps...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found