2017-08-30 59 views
3

這是錯誤:無法解析:com.android.support.constraint:constraint-佈局:1.1.0-β1

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 

,當我在升級插件單擊,沒有任何反應。我不知道如何解決這個問題。我曾嘗試添加存儲庫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' 
} 
+0

這是gradle插件。你的項目是如何構建gradle的? –

+1

set'constraint-layout:1.0.2' –

+0

https://developer.android.com/studio/build/dependencies.html#google-maven –

回答

4

要使用,你必須添加谷歌的maven回購ConstraintLayout 1.1.0β1的:

repositories { 
    maven { 
     url 'https://maven.google.com' 
    } 
} 

更多info here

+0

爲什麼不使用'repositories {google()}'? –

+1

@ThomasVos要使用'google()',您還需要插件3.3.x和gradle v.4.x.檢查https://stackoverflow.com/questions/45781489/error6-0-gradle-dsl-method-not-found-google/45854844#45854844 –