react-native-google-signin / google-signin

Google Sign-in for your React Native applications
https://react-native-google-signin.github.io/
MIT License
3.19k stars 878 forks source link

Build Failed Configuring project ':react-native-google-signin_google-signin' #1186

Closed sdancer75 closed 1 year ago

sdancer75 commented 1 year ago

I get the following build error

info Opening the app on Android...
info JS server already running.
info Installing the app...
> Task :react-native-gradle-plugin:compileKotlin UP-TO-DATE
> Task :react-native-gradle-plugin:compileJava NO-SOURCE
> Task :react-native-gradle-plugin:pluginDescriptors UP-TO-DATE
> Task :react-native-gradle-plugin:processResources UP-TO-DATE
> Task :react-native-gradle-plugin:classes UP-TO-DATE
> Task :react-native-gradle-plugin:inspectClassesForKotlinIC UP-TO-DATE
> Task :react-native-gradle-plugin:jar UP-TO-DATE

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
5 actionable tasks: 5 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':react-native-google-signin_google-signin'.
> Could not open cp_proj generic class cache for build file 'D:\myproject\node_modules\@react-native-google-signin\google-signin\android\build.gradle' (C:\Users\sdancer\.gradle\caches\7.5.1\scripts\9kaiv60vdfo5cncnkuzi4zk2a).
   > BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 63

* 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

BUILD FAILED in 23s

Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':react-native-google-signin_google-signin'.
> Could not open cp_proj generic class cache for build file 'D:\myproject\node_modules\@react-native-google-signin\google-signin\android\build.gradle' (C:\Users\sdancer\.gradle\caches\7.5.1\scripts\9kaiv60vdfo5cncnkuzi4zk2a).
   > BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 63

Steps to Reproduce

I just installed the module ie

npm i --save @react-native-google-signin/google-signin

Expected Behavior

The expected behavior is a success build

Actual Behavior

BUILD FAILED in 23s

    at makeError (D:\myproject\node_modules\execa\index.js:174:9)
    at D:\myproject\node_modules\execa\index.js:278:16
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async runOnAllDevices (D:\myproject\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:82:7)
    at async Command.handleAction (D:\myproject\node_modules\react-native\node_modules\@react-native-community\cli\build\index.js:108:9)
info Run CLI with --verbose flag for more details.

Environment

Please provide

sdancer75 commented 1 year ago

It seems it was a gradle version problem. My Java version was 19.0.2 and my gradle was 7.3

So, I updated gradle to version 7.6 inside the file project/android/gradle/wrapper/gradle-wrapper.properties distributionUrl to:

distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip

I cleaned also the cache at C:\Users\xxxxx\.gradle\caches