给定的工件包含字符串文字,该字符串文字具有程序包引用"android.support.v4.widget",无法安全地重写 [英] The given artifact contains a string literal with a package reference 'android.support.v4.widget' that cannot be safely rewritten

查看:504
本文介绍了给定的工件包含字符串文字,该字符串文字具有程序包引用"android.support.v4.widget",无法安全地重写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试将我的项目与gradle文件同步时遇到了此错误

Got this error when I tried to sync my project with gradle files

错误:清单合并失败:属性 application @ appComponentFactory 值=(android.support.v4.app.CoreComponentFactory)来自 [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91也存在于 [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 值=(androidx.core.app.CoreComponentFactory).意见建议:添加 'tools:replace ="android:appComponentFactory"'转换为元素 在AndroidManifest.xml:23:5-342:19进行覆盖.

ERROR: Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory). Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:23:5-342:19 to override.

我进行了一些研究,将android.useAndroidX=trueandroid.enableJetifier=true添加到我的 gradle.properties 文件中之后,我便能够将Gradle文件与项目同步.

I made some research and I was able to sync project with gradle files after added android.useAndroidX=true and android.enableJetifier=true to my gradle.properties file.

但是当我尝试运行我的应用程序时,出现此错误

But when I try to run my app I get this error

给定的工件包含字符串文字和包引用 无法安全重写的"android.support.v4.widget".图书馆 使用反射,例如注释处理器需要更新 手动添加对androidx的支持.

The given artifact contains a string literal with a package reference 'android.support.v4.widget' that cannot be safely rewritten. Libraries using reflection such as annotation processors need to be updated manually to add support for androidx.

我没有使用黄油刀,添加最新版本的butterkinife并没有帮助.

I am not using butterknife and adding the latest dependency of butterkinife does not help.

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation "com.android.support:support-compat:28.0.0"
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    implementation 'com.google.android.libraries.places:places:1.1.0'

    implementation 'com.isseiaoki:simplecropview:1.1.7'

    implementation 'com.github.imperiumlabs:GeoFirestore-Android:v1.1.1'
    implementation 'com.android.support:design:28.0.0'

    implementation 'com.github.bumptech.glide:glide:4.8.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.google.firebase:firebase-core:17.0.0'
    implementation 'com.google.firebase:firebase-firestore:20.0.0'
    implementation 'com.google.firebase:firebase-storage:18.0.0'
    implementation 'com.google.firebase:firebase-auth:18.0.0'
    implementation 'com.google.firebase:firebase-messaging:19.0.0'
    implementation 'com.google.firebase:firebase-functions:18.0.0'
    implementation 'com.google.firebase:firebase-config:18.0.0'

    implementation 'com.firebaseui:firebase-ui-storage:0.6.0'

    implementation 'com.firebaseui:firebase-ui-auth:4.3.1'

    implementation 'com.google.firebase:firebase-dynamic-links:18.0.0'
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'

    implementation 'com.google.android.gms:play-services-location:17.0.0'
    implementation 'com.google.android.gms:play-services-auth:17.0.0'

    implementation 'com.github.danylovolokh:hashtag-helper:1.1.0'

    implementation 'co.paystack.android:paystack:3.0.10'

    implementation 'com.facebook.android:facebook-android-sdk:4.39.0'
    implementation 'com.facebook.android:facebook-applinks:4.42.0'
    implementation 'com.facebook.android:facebook-share:4.42.0'

    implementation 'com.cuneytayyildiz:onboarder:1.0.3'

    implementation 'com.android.volley:volley:1.1.1'

    implementation 'com.github.Flutterwave:rave-android:1.0.34'

    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.9.1'
    implementation 'org.parceler:parceler-api:1.1.9'
    annotationProcessor 'org.parceler:parceler:1.1.9'
    implementation 'com.squareup.retrofit2:converter-scalars:2.1.0'
    implementation 'com.scottyab:aescrypt:0.0.1'

    implementation "android.arch.lifecycle:extensions:1.1.1"
    implementation "android.arch.lifecycle:viewmodel:1.1.1"

    implementation 'com.github.clans:fab:1.6.4'
}

我也尝试过从 Android Studio IDE 迁移到androidX

I have tried migrating to androidX from the Android Studio IDE as well

推荐答案

尝试从android studio控制台迁移到 androidX 并将 parceler 升级到 1.1.12版

Try migrating to androidX from android studio console and upgrading parceler to version 1.1.12

implementation 'org.parceler:parceler-api:1.1.12'
annotationProcessor 'org.parceler:parceler:1.1.12'

这篇关于给定的工件包含字符串文字,该字符串文字具有程序包引用"android.support.v4.widget",无法安全地重写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆