无法解决:com.android.support.constraint:constraint-layout:1.1.0-beta1

Wol*_*lvy 4 java android android-gradle-plugin android-constraintlayout

这是错误:

Error:(23, 13) Failed to resolve: com.android.support.constraint:constraint-
layout:1.1.0-beta1
Upgrade plugin to version 2.3.3 and sync project
Show in File
Show in Project Structure dialog
Run Code Online (Sandbox Code Playgroud)

当我点击升级插件时,没有任何反应.我不知道如何解决这个问题.我尝试添加存储库maven谷歌,但它不起作用.

这是应用代码:

apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
    applicationId "com.google.googleio"
    minSdkVersion 22
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support.constraint:constraint-layout:1.1.0-beta1'
}
Run Code Online (Sandbox Code Playgroud)

Gab*_*tti 7

要使用ConstraintLayout 1.1.0 beta1,您必须添加google maven repo:

repositories {
    maven {
        url 'https://maven.google.com'
    }
}
Run Code Online (Sandbox Code Playgroud)

更多信息在这里.

  • @ThomasVos要使用`google()`,你还需要插件3.3.x和gradle v.4.x. 检查/sf/ask/3204704261/#45854844 (2认同)