Kotlin

2017-05-04 11 views
3

私はkotlinから使用していますが、私は私のプロジェクトでそれを同期するときに私怒鳴るエラーを取得:Kotlin

Error:Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.2-3. 
Searched in the following locations: 
    file:/D:/android-studio/gradle/m2repository/org/jetbrains/kotlin/kotlin-gradle-plugin/1.1.2-3/kotlin-gradle-plugin-1.1.2-3.pom 
    file:/D:/android-studio/gradle/m2repository/org/jetbrains/kotlin/kotlin-gradle-plugin/1.1.2-3/kotlin-gradle-plugin-1.1.2-3.jar 
    https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.1.2-3/kotlin-gradle-plugin-1.1.2-3.pom 
    https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.1.2-3/kotlin-gradle-plugin-1.1.2-3.jar 
Required by: 
    project : 

ここでは私のbuild.gradle(Module)です:

apply plugin: 'com.android.application' 
apply plugin: 'kotlin-android' 

android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.3" 
    defaultConfig { 
     applicationId "ir.baslam.kotlinme" 
     minSdkVersion 16 
     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 'com.android.support:appcompat-v7:25.3.1' 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    testCompile 'junit:junit:4.12' 
    compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" 
} 
repositories { 
    mavenCentral() 
} 

そして、ここでは私のbuild.gradle(project)です。

// Top-level build file where you can add configuration options common to all sub-projects/modules. 

buildscript { 
    ext.kotlin_version = '1.1.2-3' 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.3.1' 
     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() 
    } 
} 

task clean(type: Delete) { 
    delete rootProject.buildDir 
} 

答えて

4
ext.kotlin_version = '1.1.2-3' 

'1.1.2-3'バージョンはjcenter repoでは使用できません。ファイルシステムでは使用できません。

1.1.2-2は、2017年4月28日の最終更新日jcenterで利用できるので、1.1.2-3の代わりに1.1.2-2バージョンを使用してください。

ext.kotlin_version = '1.1.2-2' 
+1

@ Abhishek Aryanのような他のバージョンに設定してみてください。 –

+0

ちょうど頭が上がっています: '1.1.2-3'がレポにアップしました。 – zsmb13

+1

@JoJoRoid 'kotlin_version 1.1.2-3'がデプロイされました。今すぐ使用できます。 – Aryan

0

設定したKotlin Gradleプラグインのバージョンは、リポジトリではまだ使用できません。

ext.kotlin_version = '1.1.1'