gpt4 book ai didi

android - 无法导入 gradle constraintlayout 2.0

转载 作者:搜寻专家 更新时间:2023-11-01 09:26:15 25 4
gpt4 key购买 nike

我尝试导入 constraintlayout 2.0 但没有成功如果尝试将其导入 gradle 但无法解决。但是如果我导入 constraintlayout 1.1.0 它就像一个魅力

作品:

compile 'com.android.support.constraint:constraint-layout:1.1.0'

无效:

compile 'com.android.support.constraint:constraint-layout:2.+'

为了尝试新的约束布局,我安装了android studio 3.2。我也有它附带的最新工具。我检查了 sdk 工具,但在支持存储库下看不到 constraintlayout 2.0。

android {
compileSdkVersion 'android-P'
defaultConfig {
applicationId "com.example.pteran_pc.test28"
minSdkVersion 'P'
targetSdkVersion 'P'
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.0-alpha1'
implementation 'androidx.constraintlayout:constraintlayout:2.+'
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0-alpha1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0-alpha1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha1'
}

主要构建gradle

buildscript {

repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0-alpha14'


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

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

最佳答案

alpha 版本现已可用:)

implementation 'com.android.support.constraint:constraint-layout:2.0.0-alpha1'

https://androidstudio.googleblog.com/2018/06/constraintlayout-200-alpha-1.html

关于android - 无法导入 gradle constraintlayout 2.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50394488/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com