Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when I run my project, throw this error , how can solve this ? #597

Open
vishuk570 opened this issue May 25, 2023 · 2 comments
Open

when I run my project, throw this error , how can solve this ? #597

vishuk570 opened this issue May 25, 2023 · 2 comments

Comments

@vishuk570
Copy link

buildToolsVersion = "31.0.0"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
<>
Task :react-native-keychain: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.2/userguide/command_line_interface.html#sec:command_line_warnings
334 actionable tasks: 334 executed
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: F:\tc_SEED_Project\CSD-Seed-App\node_modules@react-native-community\async-storage\android\src\main\java\com\reactnativecommunity\asyncstorage\AsyncStorageModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: F:\tc_SEED_Project\CSD-Seed-App\node_modules\react-native-geolocation-service\android\src\main\java\com\agontuk\RNFusedLocation\LocationUtils.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: F:\tc_SEED_Project\CSD-Seed-App\node_modules@react-native-google-signin\google-signin\android\src\main\java\com\reactnativegooglesignin\RNGoogleSigninModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: F:\tc_SEED_Project\CSD-Seed-App\node_modules@react-native-google-signin\google-signin\android\src\main\java\com\reactnativegooglesignin\RNGoogleSigninModule.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
F:\tc_SEED_Project\CSD-Seed-App\node_modules\react-native-keychain\android\src\main\java\com\oblador\keychain\cipherStorage\CipherStorageBase.java:528: error: lambda expressions are not supported in -source 7
public static final EncryptStringHandler encrypt = (cipher, key, output) -> {
^
(use -source 8 or higher to enable lambda expressions)
F:\tc_SEED_Project\CSD-Seed-App\node_modules\react-native-keychain\android\src\main\java\com\oblador\keychain\decryptionHandler\DecryptionResultHandlerInteractiveBiometric.java:111: error: method references are not supported in -source 7
activity.runOnUiThread(this::startAuthentication);
^
(use -source 8 or higher to enable method references)
F:\tc_SEED_Project\CSD-Seed-App\node_modules\react-native-keychain\android\src\main\java\com\oblador\keychain\decryptionHandler\DecryptionResultHandlerInteractiveBiometricManualRetry.java:78: error: method references are not supported in -source 7
activity.runOnUiThread(this::startAuthentication);
^
(use -source 8 or higher to enable method references)
F:\tc_SEED_Project\CSD-Seed-App\node_modules\react-native-keychain\android\src\main\java\com\oblador\keychain\KeychainModule.java:157: error: method references are not supported in -source 7
final Thread warmingUp = new Thread(instance::internalWarmingBestCipher, "keychain-warming-up");
^
(use -source 8 or higher to enable method references)
4 errors

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':react-native-keychain:compileDebugJavaWithJavac'.

Compilation failed; see the compiler error output for details.
<>

@varunkukade
Copy link

varunkukade commented Jun 2, 2023

@vishuk570 (use -source 8 or higher to enable method references)
This suggest that Java JDK version you are using should be same or higher than 8.
Check your java version by using java -version in terminal.

if its already greater than 8, then I found one workaround. But this is just a workaround and I am yet to find final solution.

  1. Locate the build.gradle file for the react-native-keychain module. It should be located at node_modules/react-native-keychain/android/build.gradle.
  2. In the build.gradle file, find the android section.
  3. Inside the android section, add the following lines:

codecompileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

  1. This configuration sets the source compatibility and target compatibility to Java 8.
  2. Save the build.gradle file.
  3. Clean build using cd android and ./gradlew clean
  4. Again run the app.

@varunkukade
Copy link

Keep check on #585

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants