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 文件中添加 (和你項(xiàng)目的版本號(hào)要一樣,自己拷貝過來就行了)
android {
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
}
}