2017-05-18 3 views
4

I Android Studio 3.0 Canary 1을 설치하고 kotlin으로 새 프로젝트를 만듭니다. 그리고이 오류를 얻을 : 내가 그것을 성공적으로 구축하는 것 build.gradle에서 코 틀린-안드로이드 플러그인을 제거하면Gradle 3.0.0-alpha1은 kotlin-android plugin 1.1.2-3과 호환되지 않습니까?

Error:Unable to find method 'com.android.build.gradle.internal.variant.BaseVariantData.getOutputs()Ljava/util/List;'. Possible causes for this unexpected error include:

  • Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync project (requires network)
  • The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem. Stop Gradle build processes (requires restart)
  • Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

합니다.

빌드 Gradle을 :

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 
} 

응용 프로그램 \의 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' 
} 

누군가가이 문제를 해결하는 방법을 knowes합니까?

+0

중복 질문 및 답변에 링크하여 "중복"응답을 향상시킬 수 있습니다. 우리 모두가 그걸 발견하지 못했습니다 – ErstwhileIII

답변

14

Kotlin 플러그인 버전을 1.1.2-4으로 변경해야합니다.

+1

나는이 kotlin 버전을 사용해도 같은 문제가 있습니다. –

1

이전 Android Studio 버전에서 설정을 가져올 때 이런 현상이 발생합니다. kotlin 플러그인 버전을 1.1.2-4으로 변경하고 ~/Library/Application Support/AndroidStudioPreview3.0/Kotlin (예 : Mac을 사용하는 경우)