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

Not able to build in android [solution: older android toolchains need `kotlinVersion = "1.6.21"` in `android/build.gradle` ext block] #297

Closed ForamPattha closed 1 year ago

ForamPattha commented 1 year ago

Screenshot 2022-08-18 at 3 55 28 PM

Facing above error when build in android. Try all solution but it's not working. "react-native": "0.63.2", "@invertase/react-native-apple-authentication": "^2.1.5",

konri commented 1 year ago

same here: "react-native": "^0.66.4", To build android I need to remove @invertase/react-native-apple-authentication library. In iOS it works as a charm.

mikehardy commented 1 year ago

So if you use old software that relies on old build toolchains then there is the risk of new dependency versions not working with the obsolete toolchain versions

I recognize react-native 0.66 is only about a year old, but the toolchains it was using were already a bit old when that release branch was cut

react-native 0.63 - I can't believe it even still runs as it is 2 years old :-), but it does I tested it just now.

The problem is the old android toolchains in use there do not seem to handle kotlin 1.7.x+ yet, so what you need is to modify your android/build.gradle file to have this in the ext block, pinning kotlin at the current most recent 1.6.x version, which is 1.6.21. I tested it and it works.

buildscript {
    ext {
        // ... other stuff will be in the block
        kotlinVersion = "1.6.21"  // <-- add this
    }