gpt4 book ai didi

android - 给定的 Artifact 包含一个字符串文字,其包引用为 'android.support.design.widget',无法安全重写

转载 作者:行者123 更新时间:2023-12-05 00:04:45 58 4
gpt4 key购买 nike

当我尝试构建我的项目时出现此错误:

The given artifact contains a string literal with a package reference 'android.support.design.widget' that cannot be safely rewritten I Found many similar questions but they were not helpful to me I work with this Library:

这是我在 Build:gradle 中的代码

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 28
buildToolsVersion '28.0.3'

defaultConfig {
applicationId "com.majaxtn.codingup"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'com.android.support:customtabs:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'

implementation 'com.yarolegovich:discrete-scrollview:1.4.9'
implementation 'com.google.firebase:firebase-core:17.4.3'
implementation 'com.google.firebase:firebase-auth:19.3.1'
implementation 'com.google.firebase:firebase-database:19.3.0'
implementation 'com.firebaseui:firebase-ui-auth:4.1.0'


implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.13'


implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'androidx.recyclerview:recyclerview:1.2.0-alpha03'


implementation 'androidx.appcompat:appcompat:1.1.0'




}
apply plugin: 'com.google.gms.google-services'

下面是我遇到问题的屏幕

Screenshot with error

最佳答案

我建议你升级到 AndroidX:

   dependencies {

implementation
'com.google.android.material:material:1.1.0'
implementation 'androidx.appcompat.appcompat:1.1.0'
implementation
'androidx.constraintlayout.constraintlayout:1.1.3'
implementation 'androidx.browser.browser:1.0.0
}

PS:虽然这些版本不是最新的,只是为您指明了正确的方向。

删除这些:

   implementation 
'com.android.support:customtabs:28.0.0'
implementation 'com.android.support:support-v4:28.0.0
implementation
'com.android.support.constraint:constraint-layout:1.1.3'

编辑:

将此添加到您的 gradle.properties 文件中:

android.useAndroidX=true
android.enableJetifier=true

然后在同步后进行干净的构建。

干杯!

关于android - 给定的 Artifact 包含一个字符串文字,其包引用为 'android.support.design.widget',无法安全重写,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62342123/

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