我尝试更改SDK版本和所有内容,但似乎没有运气似乎错误想留下来。
当app:Compact是25.0.1时,它表示要更改为更新版本,我尝试更改它会发生新错误。
更新版本的app:compact V7 26.0.1
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 26
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.jithendra.kotlinexample"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
}
buildscript {
ext.kotlin_version = '1.1.4'
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
}
}
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:26.0.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"
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
compile "org.jetbrains.anko:anko-commons:0.10.0"
compile (//Anko dependencies
'org.jetbrains.anko:anko-sdk15:0.8.3', //sdk19,21,23 are also available
'org.jetbrains.anko:anko-appcompat-v7:0.8.3' //for appcompact-v7 bindings
)
}
repositories {
mavenCentral()
}
答案 0 :(得分:4)
这里Android工作室要求maven库依赖。只需打开项目级别gradle并在内部添加以下内容:
allprojects{
repositories { }
}
部分(如果您没有按上述方式创建一个):
maven {
url "https://maven.google.com"
}