1,Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.
在android / build.gradle 文件中添加
android {
//加上这一段代码
if (project.android.hasProperty("namespace")) {
namespace 'com.onstar.plugin.onstar_plugin_wx'
}
}
2,Inconsistent JVM-target compatibility detected for tasks ‘compileDebugJavaWithJavac’ (1.8) and ‘compileDebugKotlin’ (17).
在android / build.gradle 文件中添加 (和你项目的版本号要一样,自己拷贝过来就行了)
android {
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
}
}