class' kotlin.unit'用不兼容的Kotlin编译。其元数据的二进制版本为1.6.0,预期版本为1.1.15
当我想使用“ react-native-webview”:“^11.22.4”
带有“ react-native-video”:“^5.2.0” 。当我想使用
D:\Document\Nodejs\Github\trender\mobile-interface\node_modules\react-native-webview\android\src\main\java\com\reactnativecommunity\webview\events\TopShouldStartLoadWithRequestEvent.kt: (28, 21):
Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.15.
The class is loaded from C:/Users/Alex/.gradle/caches/transforms-3/dd0d00050014aa294dc6be948e80b5b3/transformed/jetified-kotlin-stdlib-1.6.10.jar!/kotlin/Unit.class
我的build.gradle
文件时,问题出现了。
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "30.0.2"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 30
ndkVersion = "21.4.7075529"
kotlin_version = '1.1.15'
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath ('com.google.gms:google-services:4.3.3')
classpath("com.android.tools.build:gradle:4.2.2")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
google()
maven { url 'https://www.jitpack.io' }
jcenter() {
content {
includeModule("com.yqritc", "android-scalablevideoview")
}
}
}
}
I have this problem when I want to use "react-native-webview": "^11.22.4"
with "react-native-video": "^5.2.0"
. The problem appear when I wanted to use react native video
D:\Document\Nodejs\Github\trender\mobile-interface\node_modules\react-native-webview\android\src\main\java\com\reactnativecommunity\webview\events\TopShouldStartLoadWithRequestEvent.kt: (28, 21):
Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.15.
The class is loaded from C:/Users/Alex/.gradle/caches/transforms-3/dd0d00050014aa294dc6be948e80b5b3/transformed/jetified-kotlin-stdlib-1.6.10.jar!/kotlin/Unit.class
That's my build.gradle
file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "30.0.2"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 30
ndkVersion = "21.4.7075529"
kotlin_version = '1.1.15'
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath ('com.google.gms:google-services:4.3.3')
classpath("com.android.tools.build:gradle:4.2.2")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
google()
maven { url 'https://www.jitpack.io' }
jcenter() {
content {
includeModule("com.yqritc", "android-scalablevideoview")
}
}
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
添加
kotlinversion =“ 1.6.0”
in android/build.gradleAdd
kotlinVersion = "1.6.0"
in android/build.gradle