Android Studio中的Kotlin

用户名

我正在使用from,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
}
雅利安人
ext.kotlin_version = '1.1.2-3'

'1.1.2-3' 版本在jcenter repo中不可用,在文件系统中也不可用。

当我检查1.1.2-2jcenter中提供的最新版本最新更新为2017年4月28日)时,请使用1.1.2-2version代替1.1.2-3

ext.kotlin_version = '1.1.2-2'

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何在Android Studio中压缩Kotlin项目

在Android Studio中创建Kotlin库

如何在Android Studio中配置Kotlin版本?

Android Studio中的Kotlin插件错误

Kotlin Dokka-在android studio中找不到Dokka任务

IntelliJ / Android Studio中的Kotlin注释格式

Kotlin javaClass <>在最新的Android Studio 3.0中缺少依赖项

Kotlin在Android Studio中自动完成覆盖

在Android Studio(Kotlin)中自定义TextView(文本外观)

在Android Studio中的桌面上运行Kotlin脚本

Android Studio中缺少Kotlin暂存文件输出

在Kotlin Android Studio中声明ImageView

使用Kotlin在Android Studio中创建按钮

如何使用Android Studio / Kotlin访问FirebaseFirestore中的数组字段?

IntelliJ / Android Studio中的Kotlin函数“折叠全部”

设置Android Studio(Kotlin)中的增量和减量限制

使用PostgreSQL在android studio(kotlin)中插入记录

在Android Studio中查找重复的代码(Kotlin)

在Android Studio Kotlin中向下滑动重新加载

在Android Studio上的Kotlin中“应用”错误

无法在Android Studio中创建Kotlin片段

kotlin Android studio listView 在 Fragment 中

在 Android Studio Kotlin 中明确指定类型

Kotlin Android Studio - AlertDialog 中的 TextInputLayout

如何使用 kotlin 在 android studio 中的片段之间滑动?

Android Studio (Kotlin) 中的 id 名称为红色

android studio, kotlin 中未解决的参考 android

如何在 Kotlin/Android Studio 中删除加密文件

无法在 Kotlin (Android Studio) 中实现 Groupie