Cannot build RN App after integrating Sentry

461 Views Asked by At

OS:

  • MacOS

Platform:

  • Android

SDK:

  • @sentry/react-native (2.0.0)

react-native version: 0.61.4

Are you using Expo?

  • No

Are you using sentry.io or on-premise?

  • sentry.io (SaaS)

I have following issue:

When I try to to build the project by this command npx react-native run-android

It fires this error

Task :sentry_react-native:compileDebugJavaWithJavac FAILED 570 actionable tasks: 3 executed, 567 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':sentry_react-native:compileDebugJavaWithJavac'.
> java.time.DateTimeException: Invalid value for MonthOfYear (valid values 1 - 12): 0

Expected result:

The project should be built without issue

2

There are 2 best solutions below

1
Gaurav Roy On

Have you tried first doing

yarn add jetifier and then npx jetify

Then building your app. Try this and do let me know in case of any concerns.

0
Ahmed Mohsen On

It worked when I switched

@sentry/react-native to version "^1.3.8"

looks it was a conflict with Gradle version