invertase / react-native-apple-authentication

A React Native library providing support for Apple Authentication on iOS and Android.
Other
1.36k stars 215 forks source link

Why gradlew not building react-native-apple-authentication? #303

Closed appitsolution closed 1 year ago

appitsolution commented 1 year ago

Initially I had 0.64 react-native and SDK 43.

After that I decided to update to SDK 45 accordingly updated and react-native to version 0.68

My steps:

expo prebuild 
cd ./android
./gradlew install

I get 2 errors:

1: Task failed with an exception.
\node_modules\react-native-apple-authentication\android\build.gradle' line: 23
* What went wrong:
A problem occurred evaluating project ':react-native-apple-authentication'.
> Plugin with id 'maven' not found.

2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':react-native-apple-authentication'.
> com.android.builder.errors.EvalIssueException: compileSdkVersion is not specified. Please add it to build.gradle

* Get more help at https://help.gradle.org
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.3.3/userguide/command_line_interface.html#sec:command_line_warnings

My OS: Windows 10. My version of gradle:

------------------------------------------------------------
Gradle 7.3.3
------------------------------------------------------------

Build time:   2021-12-22 12:37:54 UTC
Revision:     6f556c80f945dc54b50e0be633da6c62dbe8dc71

Kotlin:       1.5.31
Groovy:       3.0.9
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          18.0.2.1 (Oracle Corporation 18.0.2.1+1-1)
OS:           Windows 10 10.0 amd64

My steps for solving the problem:

  1. I tried to change the version of Gradle from version 7.5 to version 6.9 - without result
  2. I also changed the version of java, at the moment I have version 18 - without result
mikehardy commented 1 year ago

Hey there - react-native wants JDK11 - https://reactnative.dev/docs/environment-setup - so be careful with that, you may experience problems (not related to this one, this one is likely not a JDK problem):

If you have already installed Node on your system, make sure it is Node 14 or newer. If you already have a JDK on your system, we recommend JDK11. You may encounter problems using higher JDK versions.


I'm not sure about windows or expo, I use mac or linux and react-native CLI, but I can tell you with react-native 0.68 it works fine with gradle anything, I use it in my work app all the time, with JDK11

But to be sure at least for windows, I just did this on my windows 11 test rig, it worked

npx --version # returned 8.15.0
node --version # returned 16.17.1
npx react-native init RNAADemo --version 0.68.3. # that is the most current version of release branch for 0.68
cd RNAADemo
yarn add react-native-apple-authentication
yarn start # in a separate terminal in my VSCode window
yarn android # after starting an android emulator

That's a minimal reproduction from scratch so it should be reproducible. Works fine for me so something must be incorrect in your local environment or with Expo, you'll have to dig more deeply to find out what it is + correct it as the problem is not in this repository

Usually before I log an issue, I start by searching for the error message, you'll note that in the results there is even an expo specific one, it may be useful

https://search.brave.com/search?q=plugin+with+id+maven+not+found

punjasin commented 1 year ago

not working with gradle 7 on lasted react native