I install Android Studio 3.0 Canary 1 and create a new project with kotlin. And get this error:
Error: cannot find method 'Com.android.build.gradle.internal.variant.BaseVariantData.getOutputs () Ljava / Util / List;'. Possible causes of this unexpected error:
- Gradle's dependency cache may be damaged (this sometimes happens after a network connection timeout.) Dependencies reload and synchronization project (network required).
- The Gradle state of the build process (daemon) may be corrupted. Stopping all Gradle daemons can solve this problem. Stop Gradle build processes (restart required)
- Your project may use a third-party plugin that is incompatible with other plugins in the project or version of Gradle requested by the project.
In the case of corrupt Gradle processes, you can also try closing the IDE and then destroying all Java processes.
If I remove the kotlin-android plugin from build.gradle, it successfully creates.
Gradle assembly:
buildscript { ext.kotlin_version = '1.1.2-3' 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:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() maven { url 'https://maven.google.com' } mavenCentral() } } task clean(type: Delete) { delete rootProject.buildDir }
Application \ build.gradle
apply plugin: 'com.android.application' apply plugin: 'kotlin-android' android { compileSdkVersion 25 buildToolsVersion "25.0.3" defaultConfig { applicationId "com.dmytrobazunov.databasetest" minSdkVersion 15 targetSdkVersion 25 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" compile 'com.android.support:appcompat-v7:25.3.1' testCompile 'junit:junit:4.12' compile 'com.android.support.constraint:constraint-layout:1.0.2' compile 'com.android.support:design:25.3.1' }
Does anyone know how to fix this problem?
android kotlin gradle
Dmytro Bazunov May 18 '17 at 19:14 2017-05-18 19:14
source share