将项目迁移到Android X后,出现标题中的错误。 gradle.app如下。如果您能帮助我,我将非常高兴。谢谢。
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.burakgon.hyperaudio"
minSdkVersion 16
targetSdkVersion 28
versionCode 1005
versionName "1005d"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
applicationVariants.all { variant ->
variant.outputs.all {
def version = variant.versionName
outputFileName = "hyperaudio-${version}.apk"
}
}
buildToolsVersion '28.0.3'
}
repositories {
maven {
url "https://jitpack.io"
}
}
ext {
supportLibVersion = '28.0.0' // variable that can be referenced to keep support libs consistent
}
答案 0 :(得分:0)
您需要在顶级gradle文件中添加google()存储库,并且它也应位于jcenter()之前:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.0.2'
}
}
allprojects {
repositories {
google()
jcenter()
}
}