react-native-webview: Plugin with id 'kotlin-android' not found - fixed
FIXED in 10.1.1
Thanks all for the report, sorry again đ˘
Original report follows:
Bug description: Cant build project by Android Studio with next error:
A problem occurred evaluating project ':react-native-webview'.
> Plugin with id 'kotlin-android' not found.
To Reproduce:
I just updated react-native-webview
from 9.4.0
to 10.1.0
.
Expected behavior: Build project successfully.
Environment:
- OS: macOS
- OS version: 10.15.4
- react-native version: 0.62.2
- react-native-webview version: 10.1.0
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 24
- Comments: 30 (8 by maintainers)
I added in
android/build.gradle
That helped but I waiting guide from maintainers.
EDIT FROM MAINTAINER: this wonât be required in versions > 10.1.0, you might want to remove it if you donât wanna risk importing 2 different versions for no reason. BTW this was a good workaround, thanks đ
To Reproduce: I just installed react-native-webview ( using npm i react-native-webview) then tried to build my project got this error
1: Task failed with an exception.
Where: Build file âC:\Users\Dell\Documents\apps\audiomessage\node_modules\react-native-webview\android\build.gradleâ line: 27
What went wrong: A problem occurred evaluating project â:react-native-webviewâ.
2: Task failed with an exception.
I used that:
buildscript { ext { ⌠kotlinVersion = â1.3.72â } dependencies { ⌠classpath âorg.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersionâ } }
and react-native install react-native-webview@10.1.0
Thanks a lot @Bardiamist
Hereâs a patch-package patch in case anyone wants to stick on v10.x - seems fine otherwise
I tried this exact transform myself (for this module) to conditional gradle inclusion after working on it with @SaeedZhiany in some of the related issues and in the modules I maintain - itâs a standard thing that works 100% of the timeâŚexcept for kotlin and I couldnât figure out why. Until someone does this will be the one module where it doesnât work I suppose but Iâm not anti-kotlin - itâs just an interoperability thing to figure out. Cheers
react-native-webview+10.1.0.patch.txt
nawa o
buildscript { ext { buildToolsVersion = â29.0.3â
I had to follow these steps:
Change kotlinVersion to kotlin_version
Change minSdkVersion 21 to 23 because of the error:
Manifest merger failed : uses-sdk:minSdkVersion 21 cannot be smaller than version 23 declared in library [:react-native-camera-kit]
Also to:
Then: https://github.com/teslamotors/react-native-camera-kit/issues/434
@Titozzz yes - if people are not using kotlin directly in their project, and if this is their only kotlin-using module, then with the dep in this moduleâs build.gradle it brings in kotlin where otherwise it wouldnât. But thatâs android development. Kotlin is a first class citizen, bringing it in is the same as when a cocoapod is using Swift or Flipper uses Swift (thatâs iOS development, it should be handled)
Yes, effectively reverting #1230 by replacing node_modules/react-native-webview/android/build.gradle with the file before the change (https://raw.githubusercontent.com/react-native-community/react-native-webview/e6241cbb6aba6e98b2e0a82011ec0aabaca854b3/android/build.gradle) fixes things
You can use the ever-impressive / always-useful patch-package (https://github.com/ds300/patch-package) to persist the change after youâve reverted locally in order to move forward
@Titozzz / @SaeedZhiany -> #1230 needs a revert đ