【问题标题】:Failed to resolve: com.android.support.constraint:constraint- layout:1.1.0-beta1无法解决:com.android.support.constraint:constraint-layout:1.1.0-beta1
【发布时间】:2018-02-08 04:20:36
【问题描述】:

这是错误:

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 google,但它不起作用。

这是应用程序代码:

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'
}

【问题讨论】:

  • 这是 gradle 插件。你的项目构建 gradle 是什么样子的?
  • 设置constraint-layout:1.0.2
  • 设置约束布局有效,但现在我有代码错误,我下载了一个模板
  • 将 mavenCentral() 添加到你的仓库@Wolvy

标签: java android android-gradle-plugin android-constraintlayout


【解决方案1】:

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

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

更多info here.

【讨论】:

猜你喜欢
  • 2019-11-14
  • 1970-01-01
  • 2023-03-24
  • 1970-01-01
  • 2021-12-07
  • 2019-05-11
  • 1970-01-01
  • 1970-01-01
  • 2018-07-17
相关资源
最近更新 更多