美文网首页
Android studio 3.0 Unable to res

Android studio 3.0 Unable to res

作者: Allens_Jiang | 来源:发表于2018-06-06 15:48 被阅读271次

    兴建的工程 就出现这个错误

    出现的异常

    Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support.constraint:constraint-layout:1.1.1.
    Open File
    Show Details
    
    

    Google 了一把 各种回答

    解决方案

    看错误的信息

    Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support.constraint:constraint-layout:1.1.1.
    

    我的理解 不能加载1.1.1 版本的 那么 就改成

    apply plugin: 'com.android.application'
    
    android {
        compileSdkVersion 27
        defaultConfig {
            applicationId "com.allens.test"
            minSdkVersion 19
            targetSdkVersion 27
            versionCode 1
            versionName "1.0"
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }
    
    dependencies {
    
        //noinspection GradleCompatible
        implementation 'com.android.support:appcompat-v7:27.1.1'
     //   implementation 'com.android.support.constraint:constraint-layout:1.1.1'
    //替换陈这个版本的
       implementation 'com.android.support.constraint:constraint-layout:1.1.0'
        implementation 'com.android.support:support-v4:27.1.1'
        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'
    
    }
    
    

    build

    ok

    相关文章

      网友评论

          本文标题:Android studio 3.0 Unable to res

          本文链接:https://www.haomeiwen.com/subject/fxgbsftx.html