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

react-native-webview error, supports only kotlin-android-extensions Gradle plugin version 1.6.20 and higher. #610

Open
BrianAutomatize opened this issue Oct 17, 2023 · 1 comment

Comments

@BrianAutomatize
Copy link

getting

Android gradle plugin: 7.3.1
Gradle: 7.5.1
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.

FAILURE: Build failed with an exception.

* What went wrong:
The Android Gradle plugin supports only kotlin-android-extensions Gradle plugin version 1.6.20 and higher.
The following dependencies do not satisfy the required version:
project ':react-native-webview' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.0

when running project using
import { Camera } from 'react-native-camera-kit';
of course works great with ios but android will not build.

To Reproduce
Steps to reproduce the behavior:
using
"dependencies": {
"react-native": "0.71.6",
"react-native-reanimated": "3.5.2",
"react-native-webview": "^13.6.2",
"react-native-camera-kit": "^13.0.0",
"bootstrap": "^5.3.2",
}
calling like
import { Camera } from 'react-native-camera-kit';
<Camera
scanBarcode={true}
onReadCode={(event: any) => {
handleOnReadCode(event);
}}
showFrame={true}
laserColor="red"
frameColor="white"
/>
like stated works fine on ios but will not build on android
added from
https://github.com/teslamotors/react-native-camera-kit/blob/master/docs/kotlin.md

android>build.gradle
buildscript {
    ext {
        buildToolsVersion = "33.0.0"
        minSdkVersion = 23
        compileSdkVersion = 33
        targetSdkVersion = 33
        kotlin_version = "1.7.20"
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:7.3.1")
        classpath("com.facebook.react:react-native-gradle-plugin")
        classpath("com.google.gms:google-services:4.3.14")
        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
    }
}

allprojects {
    repositories {
        google()
     }
}
and
android>app>build.gradle
apply plugin: "com.android.application"
apply plugin: "com.facebook.react"
apply plugin: "com.google.gms.google-services"
apply plugin: "kotlin-android"
apply plugin: "kotlin-android-extensions"

tried various numbers, all i could think of for kotlin_version = "1.7.20", "1.7.10", and many others to no avail
Screenshot 2023-10-17 at 8 15 37 AM
macos ventura 13.2.1

TRYING DESPERTELY to add a qr scanner,
since react-native-camera is decprecated, and react-native-vision-camera doesn't implement a qr scanner , thought this was best option any help on build process for android is greatly appreciated.

@yasirlateef
Copy link

I came across a workaround which basically suggested applying a patch for react-native-webview. I'll share the contents of patch file below:

diff --git a/node_modules/react-native-webview/android/build.gradle b/node_modules/react-native-webview/android/build.gradle
index f68fa80..6e52d07 100644
--- a/node_modules/react-native-webview/android/build.gradle
+++ b/node_modules/react-native-webview/android/build.gradle
@@ -9,7 +9,7 @@ buildscript {
         gradlePluginPortal()
     }
     dependencies {
-        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion')}")
+        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.20"
         classpath("com.android.tools.build:gradle:7.0.4")
     }
 }

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