将我的项目迁移到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
}发布于 2018-11-14 19:12:47
您需要在顶层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()
}
}https://stackoverflow.com/questions/53298829
复制相似问题