Change import android.support.annotation.Nullable;
Copser opened this issue · comments
Hey,
I'm referring to my issue from a few days ago in regard of me changing
import android.support.annotation.Nullable;
to androidx.annotation.Nullable
in Utils and AddCalendarEventModule.
I've found out that maybe it's better to use javax.annotation.Nullable
from maven, so is this and option for you to use in the project or not?
Thanks
Hey @vonovak I've created a PR for this issue, so if it's ok with you I'll push my changes for review, thanks.
Task :react-native-add-calendar-event:compileDebugJavaWithJavac FAILED
/Users/.../node_modules/react-native-add-calendar-event/android/src/main/java/com/vonovak/Utils.java:8: error: package android.support.annotation doe
s not exist
import android.support.annotation.Nullable;
^
/Users/.../node_modules/react-native-add-calendar-event/android/src/main/java/com/vonovak/AddCalendarEventModule.java:14: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
^
/Users/.../node_modules/react-native-add-calendar-event/android/src/main/java/com/vonovak/Utils.java:25: error: cannot find symbol
@nullable
^
symbol: class Nullable
location: class Utils
/Users/.../node_modules/react-native-add-calendar-event/android/src/main/java/com/vonovak/AddCalendarEventModule.java:212: error: cannot find symbol
private void returnResultBackToJS(@nullable Long eventPostId) {
^
symbol: class Nullable
location: class AddCalendarEventModule
Note: /Users/.../node_modules/react-native-add-calendar-event/android/src/main/java/com/vonovak/AddCalendarEventModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/.../node_modules/react-native-add-calendar-event/android/src/main/java/com/vonovak/AddCalendarEventModule.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
4 errors
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ':react-native-add-calendar-event:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
-
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. -
Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 26s
39 actionable tasks: 6 executed, 33 up-to-date
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
Can we Help this error? I am stuck in my Project
hi! yes, using, androidX would be nice. I'll merge such PR, thanks.
@MITDD6338 current workaround, at least that is what I did, I have forked the repo and changed the import statements to support AnroidX, and in package.json
I'm installing react-native-add-calendar-event
with
"react-native-add-calendar-event": "https://github.com/username/react-native-add-calendar-event.git#fixImports",
It's not ideal, but it should do the job :)
Hey @MITDD6338, the link should be something like this
https://github.com/MITDD6338/react-native-calendars.git#fixImports
you are pointing out to the wrong repository, I hope this can help, also don't forger to changed the import statements to support AndoridX.
@Copser would you mind opening a PR instead of using forks?
@Copser this is different
https://github.com/MITDD6338/react-native-calendars.git#fixImports
they are should be a different library, not react-native-add-calendar-event
@Copser this is different
https://github.com/MITDD6338/react-native-calendars.git#fixImportsthey are should be a different library, not react-native-add-calendar-event
Yup, my mistake it should be this library, I'm also using the other one, and I needed the same thing for that one.
@vonovak all prep, can you please give me permission so I can push PR, thanks.
@Copser you do not need any permission - just push the changes to your fork and open a PR from there - see https://help.github.com/en/articles/creating-a-pull-request-from-a-fork