显示:未能解决: com.android.support:support-v4:30.0.0添加Google存储库和同步项目显示在项目结构对话框中,受影响模块: app
build.gradle(:app):
应用插件:'com.android.application‘
安卓{ compileSdkVersion 30 buildToolsVersion '30.0.2‘
defaultConfig {
applicationId "com.example.android.miwok"
minSdkVersion 15
targetSdkVersion 30
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:30.0.0'
implementation 'com.android.support:support-v4:30.0.0'
implementation 'com.android.support:design:30.0.0'
}发布于 2020-10-14 10:55:47
现在主要使用androidx库--您现在需要使用这个库:
若要使用此功能,需要将Androidx支持添加到项目中,如果项目未迁移到Androidx中的话。
您可以在这里找到如何将项目迁移到仙女座。
implementation 'androidx.appcompat:appcompat:1.2.0'或者使用最后一个support library
implementation 'com.android.support:appcompat-v7:28.0.0'这是因为您试图使用的support libraries不存在。
对于添加Google Maven repository和google(),在app目录之外的build.gradle中执行此操作。
allprojects {
repositories {
google()
maven {
url 'https://maven.google.com'
}
jcenter()
}
}发布于 2020-10-14 10:56:48
支持库v30 不存在。
把他们移走。
使用雄激素库
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.2.1'要使用它们,必须将google()回购添加到顶级build.gradle文件中:
allprojects {
repositories {
google()
jcenter()
}
}https://stackoverflow.com/questions/64351693
复制相似问题