react-native-calendar-events: :react-native-calendar-events:compileReleaseJavaWithJavac FAILED

After update to version 1.4.0 I got error when run cd android && ./gradlew assembleRelease

:react-native-calendar-events:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
/opt/app/gift_demo/node_modules/react-native-calendar-events/android/src/main/java/com/calendarevents/CalendarEvents.java:29: error: cannot find symbol
import com.facebook.react.bridge.Dynamic;
                                ^
  symbol:   class Dynamic
  location: package com.facebook.react.bridge
/opt/app/gift_demo/node_modules/react-native-calendar-events/android/src/main/java/com/calendarevents/CalendarEvents.java:114: error: cannot find symbol
    public WritableNativeArray findEvents(Dynamic startDate, Dynamic endDate, ReadableArray calendars) {
                                          ^
  symbol:   class Dynamic
  location: class CalendarEvents
/opt/app/gift_demo/node_modules/react-native-calendar-events/android/src/main/java/com/calendarevents/CalendarEvents.java:114: error: cannot find symbol
    public WritableNativeArray findEvents(Dynamic startDate, Dynamic endDate, ReadableArray calendars) {
                                                             ^
  symbol:   class Dynamic
  location: class CalendarEvents
/opt/app/gift_demo/node_modules/react-native-calendar-events/android/src/main/java/com/calendarevents/CalendarEvents.java:685: error: cannot find symbol
    public void findAllEvents(final Dynamic startDate, final Dynamic endDate, final ReadableArray calendars, final Promise promise) {
                                    ^
  symbol:   class Dynamic
  location: class CalendarEvents
/opt/app/gift_demo/node_modules/react-native-calendar-events/android/src/main/java/com/calendarevents/CalendarEvents.java:685: error: cannot find symbol
    public void findAllEvents(final Dynamic startDate, final Dynamic endDate, final ReadableArray calendars, final Promise promise) {
                                                             ^
  symbol:   class Dynamic
  location: class CalendarEvents
5 errors
:react-native-calendar-events:compileReleaseJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-calendar-events:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

My dependency

“react-native”: “0.41.2”, “react-native-calendar-events”: “1.4.0”

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 2
  • Comments: 16 (3 by maintainers)

Commits related to this issue

Most upvoted comments

I have the same issue with 0.62.2 and jetifier 😕

@vseprav @mariapotashnyk I think the class Dynamic was introduced in React Native’s 0.42.0 release. If possible, you can try updating your version of React Native to gain reference to the new class. I will also make a note in the readme.

switched to 1.3.6 version and all works

@matheusbaumgart , try npm run jetify

Also getting this issue on React Native 0.61.1

@anagar23 , I got the same error as you did two days ago, were you able to solve it? Should a new issue be opened?

/Users/danale/Projects/NFIBEngage/node_modules/react-native-calendar-events/android/src/main/java/com/calendarevents/CalendarEvents.java:14: error: cannot find symbol
import android.support.v4.app.ActivityCompat;
                             ^
  symbol:   class ActivityCompat
  location: package android.support.v4.app
/Users/danale/Projects/NFIBEngage/node_modules/react-native-calendar-events/android/src/main/java/com/calendarevents/CalendarEvents.java:15: error: package android.support.v4.content does not exist
import android.support.v4.content.ContextCompat;
                                 ^
/Users/danale/Projects/NFIBEngage/node_modules/react-native-calendar-events/android/src/main/java/com/calendarevents/CalendarEvents.java:71: error: cannot find symbol
        ActivityCompat.requestPermissions(currentActivity, new String[]{
        ^
  symbol:   variable ActivityCompat
  location: class CalendarEvents
/Users/danale/Projects/NFIBEngage/node_modules/react-native-calendar-events/android/src/main/java/com/calendarevents/CalendarEvents.java:95: error: cannot find symbol
        int writePermission = ContextCompat.checkSelfPermission(reactContext, Manifest.permission.WRITE_CALENDAR);
                              ^
  symbol:   variable ContextCompat
  location: class CalendarEvents
/Users/danale/Projects/NFIBEngage/node_modules/react-native-calendar-events/android/src/main/java/com/calendarevents/CalendarEvents.java:96: error: cannot find symbol
        int readPermission = ContextCompat.checkSelfPermission(reactContext, Manifest.permission.READ_CALENDAR);
                             ^
  symbol:   variable ContextCompat
  location: class CalendarEvents
5 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-calendar-events:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

@rodrigooler, v1.4.2 of this package needs the latest RN 0.47 release. For prior releases, you can use v1.4.1.