Tag: Android即时应用

在Instant App中应用插件“kotlin-android”会导致“null不能转换为非空types的com.android.build.gradleBasePlugin”

我一直在试图将新公开发布的Android即时应用和Kotlin编程语言结合起来。 在使用以下(标准?)设置创建我的项目后,当我尝试构建应用程序时,出现错误消息“null不能转换为非空typescom.android.build.gradle.BasePlugin” 。 使用Kotlin可以很好的使用标准的“com.android.application”模块; 仅当我尝试在即时应用程序模块中使用它时,才会引发错误。 顶级build.gradle : buildscript { repositories { maven { url ‘https://maven.google.com’ } jcenter() } dependencies { classpath “com.android.tools.build:gradle:3.0.0-alpha1” classpath “org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.2-4” } } // … 应用程序模块build.gradle ,其中Kotlin工作: apply plugin: ‘com.android.application’ apply plugin: ‘kotlin-android’ // This will work. android { compileSdkVersion 25 buildToolsVersion “25.0.2” defaultConfig { // … } buildTypes { release { […]