你好,我是Android新手。我被卡在这里,出现此错误:
无法解析外部依赖项org.jetbrains.kotlin:kotlin-gradle- 插件:1.3.31,因为未定义存储库。要求: 项目:app
build.gradle
模块
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 29
buildToolsVersion "29.0.0"
defaultConfig {
applicationId "com.ahmadnaser.startapp"
minSdkVersion 26
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
debug {
buildConfigField "String", "APP_ID", "\"ec5617b9-b9e4-4cbf-b7c1-91d8aea47bb2\""
buildConfigField "String", "CLIENT_KEY", "\"185c55ba-b15f-4f1d-991f-95fdaf9a85b3\""
buildConfigField "String", "SERVER_URL", "\"https://antest123.azurewebsites.net/parse\""
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:29.0.0'
implementation 'com.android.support:support-v4:29.0.0'
implementation 'com.android.support:design:29.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:cardview-v7:29.1.0'
implementation 'com.android.support:recyclerview-v7:29.1.0'
implementation 'com.parse:parse-android:1.15.7'
testImplementation 'junit:junit:4.12'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
buildscript {
ext.kotlin_version = '1.3.31'
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.31"
}
}
build.gradle
应用
buildscript {
ext.kotlin_version = '1.3.31'
repositories {
google()
jcenter()
maven { url 'http://myrepourl/repo' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.0-alpha03'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.31"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url 'http://myrepourl/repo' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我该怎么做才能解决此错误?