请选择 进入手机版 | 继续访问电脑版
  • 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

android - 无法解析 : com. android.support :design-v7:27. 1.1

[复制链接]
菜鸟教程小白 发表于 2022-12-9 06:01:46 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题

我使用的是 Android Studio 3.1.3。 Gradle 构建同步失败。我使用了以下方法,但没有用。如果有解决办法请告诉我

  1. maven { url "https://maven.google.com"}

  2. 使重启和缓存无效

  3. multiDexEnabled true

  4. 添加 mavenLocal()mavenCentral()

    这是模块级 build.gradle 文件:

    android {
            compileSdkVersion 27
            defaultConfig {
                applicationId "com.developers.a_g.designapp"
                minSdkVersion 15
                targetSdkVersion 27
                buildToolsVersion '27.1.1'
                versionCode 1
                versionName "1.0"
                multiDexEnabled true
                testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
            }
            buildTypes {
                release {
                    minifyEnabled false
                    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
                }
            }
        }
    
    dependencies {
        implementation fileTree( dir: 'libs',include: ['*.jar'])
        implementation 'com.android.support:appcompat-v7:27.1.1'
        implementation 'com.android.support.constraint:constraint-layout:1.1.2'
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'com.android.support.test:runner:1.0.2'
        androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
        implementation 'com.android.support:cardview-v7:27.1.1'
        implementation 'com.android.support:design-v7:27.1.1'
        implementation 'com.rengwuxian.materialedittext:library:2.1.4'
        implementation 'com.szagurskii:patternedtextwatcher:0.5.0'
        implementation 'com.github.d-max:spots-dialog:0.7@aar'
        implementation 'com.squareup.retrofit2:retrofit:2.3.0'
        implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
    }
    
    
     android {
            compileSdkVersion 27
            defaultConfig {
                applicationId "com.developers.a_g.designapp"
                minSdkVersion 15
                targetSdkVersion 27
                buildToolsVersion '27.1.1'
                versionCode 1
                versionName "1.0"
                multiDexEnabled true
                testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
            }
            buildTypes {
                release {
                    minifyEnabled false
                    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
                }
            }
        }
    
    dependencies {
        implementation fileTree( dir: 'libs',include: ['*.jar'])
        implementation 'com.android.support:appcompat-v7:27.1.1'
        implementation 'com.android.support.constraint:constraint-layout:1.1.2'
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'com.android.support.test:runner:1.0.2'
        androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
        implementation 'com.android.support:cardview-v7:27.1.1'
        implementation 'com.android.support:design-v7:27.1.1'
        implementation 'com.rengwuxian.materialedittext:library:2.1.4'
        implementation 'com.szagurskii:patternedtextwatcher:0.5.0'
        implementation 'com.github.d-max:spots-dialog:0.7@aar'
        implementation 'com.squareup.retrofit2:retrofit:2.3.0'
        implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
    }
    

这是项目级别的 build.gradle 文件:

    buildscript {

        repositories {

            jcenter()
            google()


            maven {
                url "https://maven.google.com"
            }
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.1.3'
        }
    }

    allprojects {
        repositories {
            google()
            jcenter()
        }
    }

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



Best Answer-推荐答案


首先确保您使用的是:

targetSdkVersion 27
compileSdkVersion 27
buildToolsVersion '27.0.3'

你的毕业典礼是这样的:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        google()
        //..
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'

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

allprojects {
    repositories {
        google()
        //..
    }
}

并且还更新设计实现如下:

implementation 'com.android.support:design:27.1.1'

你得到这个错误是因为 com.android.support:design-v7 不存在它没有 -v7 存在,你也可以检查支持库 in this link随时确保您使用的是正确的库。

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

回复

使用道具 举报

懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注0

粉丝2

帖子830918

发布主题
阅读排行 更多
广告位

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap