Task :react-native-community_slider:compileDebugJavaWithJavac FAILED
Environment
System: OS: Windows 10 10.0.19042 CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz Memory: 2.67 GB / 15.77 GB Binaries: Node: 14.17.4 - C:\Program Files\nodejs\node.EXE Yarn: 1.16.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 6.14.14 - C:\Program Files\nodejs\npm.CMD Watchman: Not Found SDKs: Android SDK: API Levels: 27, 28, 29, 30 Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.2, 30.0.3 System Images: android-28 | Android TV Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom Android NDK: Not Found Windows SDK: Not Found IDEs: Android Studio: Version 3.5.0.0 AI-191.8026.42.35.5791312 Visual Studio: 16.1.29009.5 (Visual Studio Community�2019) Languages: Java: 1.8.0_221 - C:\Program Files\Java\jdk1.8.0_221\bin\javac.EXE npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.64.2 => 0.64.2 react-native-windows: Not Found npmGlobalPackages: react-native: Not Found
Description
Hello, i have this issue when i add the package on my project.
Task :react-native-community_slider:compileDebugJavaWithJavac FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings 280 actionable tasks: 22 executed, 258 up-to-date XXXXXXPATHOFPROJECT\node_modules@react-native-community\slider\android\src\main\java\com\reactnativecommunity\slider\ReactSliderManager.java:152: error: cannot find symbol if (view.isAccessibilityFocused() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { ^ symbol: variable R location: class VERSION_CODES
Reproducible Demo
npm install @react-native-community/slider --save
My version of react native is "react-native": "0.64.2"
Hello again, @centotaure!
Thank you for reporting that.
I assume you are using the latest version (v4.1.8), as this version introduced the VERSION_CODES check.
If you take a look at the latest changes delivered in PR #324 you will see that the VERSION_CODES require the SDK to be at 30.
Although I've updated it for both this package and the example app, it is also required to update it for the app which uses this package.
Can you then please check if setting your compileSdkVersion to 30 just like here solves your issue?
Take a look at the diff of required changes presented below:
diff --git a/example/android/build.gradle b/example/android/build.gradle
index 89eb221..4a1a897 100644
--- a/example/android/build.gradle
+++ b/example/android/build.gradle
@@ -4,7 +4,7 @@ buildscript {
ext {
buildToolsVersion = "29.0.3"
minSdkVersion = 21
- compileSdkVersion = 29
+ compileSdkVersion = 30
targetSdkVersion = 29
}
repositories {
Also, let me know please if this is any problem for you to use version 30.
It's works thanks a lot !