gpt4 book ai didi

android - 无法解析 com.android.support :design 28. 0.0

转载 作者:行者123 更新时间:2023-12-02 09:09:34 26 4
gpt4 key购买 nike

当我想添加 float EditText 时,我在新的 Android Studio 版本中遇到错误。如果我在 gradle 文件中添加这个,我需要添加这个 android.support.design 库

这是我在 logcat 中遇到的错误

Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support:design-v7:28.0.0 Open File Show Details

Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.android.support:design-v7:28.0.0. Open File Show Details

Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.android.support:design-v7:28.0.0. Open File Show Details

Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve com.android.support:design-v7:28.0.0. Open File Show Details

Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve com.android.support:design-v7:28.0.0. Open File Show Details



注意:我引用了更多链接,即使我没有得到解决方案,我也尝试了所有解决方案。

我已经在 gradle 中取消选中了离线工作。我也在 gradle 文件中添加了 maven 并清理、重建了项目,即使我没有得到解决方案。

这是 gradle 文件:
apply plugin: 'com.android.application'    

repositories {
maven { url "https://jitpack.io" }


}

android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "fadila.new_tech.app"
minSdkVersion 16
targetSdkVersion 28
versionCode 6
versionName "1.5"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

}

dependencies {

compile fileTree(include: ['*.jar'], dir: 'libs')

implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'

}

这是 Gradle(PRjoect 模块)
buildscript {

repositories {
google()
jcenter()
maven {
url 'https://maven.google.com' //put it here
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'


// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
jcenter()
maven {
url 'https://maven.google.com' //put it here
}
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

查看 SDK Manager 镜像 我已经更新了 28 版本
enter image description here
enter image description here

最佳答案

您可以尝试使用加号编译包

implementation 'com.android.support:design:28.0.+'

或者
implementation 'com.android.support:design:28.+'

但是google改了包名, all packages mapping here

All new Support Library development will occur in the AndroidX library



所以你必须使用
implementation 'com.google.android.material:material:1.0.0'

代替
implementation 'com.android.support:design:28.0.+'

关于android - 无法解析 com.android.support :design 28. 0.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54115134/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com