Closed IgorVanian closed 8 months ago
+1
How can we resolve this for now?
@shuklaaalind I opened a PR for this. But for the moment you can add a custom kotlin version to your project like so:
buildscript {
ext {
buildToolsVersion = "32.0.0"
minSdkVersion = 21
compileSdkVersion = 33
targetSdkVersion = 32
androidXBrowser = "1.4.0"
kotlinVersion = "1.8.0"
}
...
}
For those who setting kotlinVersion = "1.8.0"
in build.gradle
doesn't fix the issue, you can set androidXVersion = "1.5.+"
instead.
If you look in the inappbrowser
build.gradle
:
def androidXVersion = safeExtGet('androidXVersion', null)
if (supportLibVersion && androidXVersion == null) {
implementation "com.android.support:support-annotations:$supportLibVersion"
implementation "com.android.support:customtabs:$supportLibVersion"
} else {
def defaultAndroidXVersion = "1.+"
if (androidXVersion == null) {
androidXVersion = defaultAndroidXVersion
}
def androidXVersion = safeExtGet('androidXVersion', null)
This line will get the androidXVersion
defined in your build.gradle
and use it instead of the default "1.+"
.
Took for me two days of investigation , after adding kotlinVersion = "1.8.0" to the build.gradle file it's working for me right now .
Which platform(s) does your issue occur on?
TL;DR
This line currently installs version 1.6.0 of annotations https://github.com/proyecto26/react-native-inappbrowser/blob/e028173df5ffea7b8c1f3214669cdde33981ee14/android/build.gradle#L67
This version has a
kotlin-stdlib:1.8.0
dependency. By default gradle is using the higher version of this lib in the project, which makes this issue to pop up.Long version
Hello. After a lot of debugging, I finally found why current Android builds fail with the following error:
This is due to the merge of jdk7 & jdk8 artifacts that occured in
kotlin-stdlib:1.8.0
. This results in an error if you use packages that havekotlin-stdlib-jdk7/8 < 1.8.0
.From
gradle dependencies
I saw that this package is requiring the latest version of annotations:Which can be found here:
https://github.com/proyecto26/react-native-inappbrowser/blob/e028173df5ffea7b8c1f3214669cdde33981ee14/android/build.gradle#L61
The latest 1.6.0 version includes a kotlin 1.8.0 dependency that enables this issue and makes the build fail.
To fix this issue for the moment, we had to specify a fixed
kotlinVersion=1.8.0
in thebuild.gradle
file.