我在 Chip-Group 部分遇到了问题。Chip和Chip-Group是我第一次使用,所以一定要下载。当我点击下载按钮时。他们问我:“这个操作需要库com.google.android.material:material:+,你现在要添加这个吗?”如果我按“是”按钮,材料添加正确但有错误。当我单击运行按钮时出现错误。错误信息是:apply from: "$rootProject.projectDir/gradle.properties"apply plugin: 'com.android.application'android { compileSdkVersion versions.compileSdk buildToolsVersion "${versions.buildTools}"defaultConfig { applicationId "com.twilio.video.quickstart" minSdkVersion versions.minSdk targetSdkVersion versions.targetSdk versionCode 1 versionName "1.0" buildConfigField("String", "TWILIO_ACCESS_TOKEN", "\"${getSecretProperty("TWILIO_ACCESS_TOKEN", "TWILIO_ACCESS_TOKEN")}\"") buildConfigField("String", "TWILIO_ACCESS_TOKEN_SERVER", "\"${getSecretProperty("TWILIO_ACCESS_TOKEN_SERVER", "https://secure.advcare.info/mobapp/v1.0/adv/")}\"") buildConfigField("boolean", "USE_TOKEN_SERVER", "${getSecretProperty("USE_TOKEN_SERVER", false)}")}compileOptions { sourceCompatibility versions.java targetCompatibility versions.java}buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' }}// Specify that we want to split up the APK based on ABIsplits { abi { // Enable ABI split enable true // Clear list of ABIs reset() // Specify each architecture currently supported by the Video SDK include "armeabi-v7a", "arm64-v8a", "x86", "x86_64" // Specify that we do not want an additional universal SDK universalApk false }}}}如果我从代码中删除材料('com.google.android.material:material:1.0.0')我的程序运行正常。
3 回答

临摹微笑
TA贡献1982条经验 获得超2个赞
首先将您的项目迁移到
androidX
going torefactor -> Migrate to androidX
。添加依赖实现
'com.google.android.material:material:1.0.0
'
或implementation
'com.google.android.material:material:1.1.0-alpha08
'
然后将 Chip-Group 用作:
<com.google.android.material.chip.ChipGroup android:id="@+id/reflow_group" android:layout_width="match_parent" android:layout_height="wrap_content"> <com.google.android.material.chip.Chip android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/txt_this" /> </com.google.android.material.chip.ChipGroup>

慕少森
TA贡献2019条经验 获得超9个赞
在模块 classes.jar (androidx.core....) 和 classes.jar (com.android.support....) 中发现重复类 (...)
尝试将您的代码迁移到 androidX,这应该可以解决问题。

12345678_0001
TA贡献1802条经验 获得超5个赞
我认为这是对的,但它对我不起作用。当我在Gradle.properties 文件中放入 “android.useAndroidX=true android.enableJetifier=true”时,出现错误:
错误:
无法为类型为 org.gradle.api.Project 的项目“:quickstart”获取未知属性“android”。
添加回答
举报
0/150
提交
取消