【发布时间】:2021-12-22 12:12:30
【问题描述】:
我在我的 react native 项目中实现了 AWS chime。正如here 提到的,我必须将以下配置添加到我的项目中。
build.gradle 文件更改
buildscript {
ext.kotlin_version = '1.3.71'
...
dependencies {
...
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
app/build.gradle 文件更改
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
dependencies {
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.3'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.3'
implementation 'androidx.core:core-ktx:1.1.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
当我配置这些更改时,在yarn android(构建)之后,我的构建失败,.kt 文件错误出现在node_modules。
e: /projects/rndemo/node_modules/expo/android/src/main/java/expo/modules/ExpoModulesPackage.kt: (27, 9): Type inference failed: Not enough information to infer parameter T in fun <T> emptyList(): List<T>
Please specify it explicitly.
e: /projects/rndemo/node_modules/expo/android/src/main/java/expo/modules/ReactActivityDelegateWrapper.kt: (48, 12): Type inference failed: fun <T, A> invokeDelegateMethod(name: String, argTypes: Array<Class<*>>, args: Array<A>): T
cannot be applied to
(String,Array<Class<*>>,Array<String?>)
如果没有上述配置更改,应用程序可以正常工作。
这是什么原因?
有没有办法跳过使用指定 kotlin 版本编译的节点模块?
【问题讨论】:
标签: android react-native kotlin expo