Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
cepv2010 opened this issue Dec 3, 2018 · 9 comments

Comments

@cepv2010
Copy link

cepv2010 commented Dec 3, 2018

I'm Trying to implement butterknife:9.0.0-rc2 with Dagger 2.19 and Jetifier = enable, but i get the next error:

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

How can solve this issue?

thanks for your kind help.

@JakeWharton
Copy link
Owner

See #1395 (comment) for a workaround of this jetifier problem. No action to take on our side.

@AltonDsouza
Copy link

I get the same error , I migrated my existing project to androidx thats when i got this error, tried upgrading version to 10.2.0 and added compileOptions in build.gradle.
The findById is not recognized. Some workAround for this?? Thank you.

@rakeshbaral92
Copy link

Is there any solution yet. I have stuck after migrating my project to androidx.

@ldavidsp
Copy link

ldavidsp commented Jan 7, 2020

Change to these parameters in build.gradle, it worked for me using version butterknife:10.2.1

testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

@Srikanth9792
Copy link

Hi
I am also facing same issue after made below changes also & I am not able to run test cases

testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

@endlesstech
Copy link

endlesstech commented Jan 30, 2020

I also got the same issue. Please share the best solution for it.

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.

Used libraries

implementation 'androidx.vectordrawable:vectordrawable-animated:1.0.0'
implementation 'androidx.browser:browser:1.0.0'
implementation 'androidx.core:core:1.0.0'
implementation 'androidx.legacy:legacy-support-core-utils:1.0.0'
implementation 'androidx.legacy:legacy-support-core-ui:1.0.0'
implementation 'androidx.media:media:1.0.0'
implementation 'androidx.fragment:fragment:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation 'androidx.palette:palette:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.legacy:legacy-support-v13:1.0.0'
implementation 'androidx.legacy:legacy-preference-v14:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.mediarouter:mediarouter:1.0.0'
implementation 'androidx.emoji:emoji-appcompat:1.0.0'
implementation 'androidx.emoji:emoji-bundled:1.0.0'
implementation 'androidx.emoji:emoji:1.0.0'
compileOnly 'javax.annotation:jsr250-api:1.0'
implementation 'com.github.hani-momanii:SuperNova-Emoji:1.1'
implementation 'org.jsoup:jsoup:1.10.3'
implementation 'com.leocardz:link-preview:1.2.2@aar'
implementation 'com.koushikdutta.urlimageviewhelper:urlimageviewhelper:1.0.4'
implementation 'net.openid:appauth:0.2.0'
implementation "com.onesignal:OneSignal:$oneSignalVersion"
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation "com.google.android.gms:play-services-maps:$gplayVersion"
implementation "com.google.android.gms:play-services-location:$gplayVersion"
implementation "com.google.android.gms:play-services-gcm:$gplayVersion"
implementation "com.google.android.gms:play-services-auth:$gplayVersion"
implementation 'com.google.android.gms:play-services-places:16.0.0'
implementation 'com.google.maps.android:android-maps-utils:0.5+'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.6.3'
implementation 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'androidx.annotation:annotation:1.0.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.facebook.stetho:stetho:1.5.0'
implementation 'com.uphyca:stetho_realm:2.0.0'
implementation 'net.sf.supercsv:super-csv-java8:2.4.0'
implementation 'androidx.multidex:multidex:2.0.0'
implementation 'com.malinskiy:superrecyclerview:1.1.4'

implementation 'org.parceler:parceler-api:1.1.5'
implementation 'io.realm:android-adapters:1.3.0'
implementation 'net.danlew:android.joda:2.9.4.2'
implementation 'com.squareup.wire:wire-runtime:1.2.0'
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
implementation 'fr.avianey.com.viewpagerindicator:library:2.4.1@aar'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.jakewharton:butterknife:10.0.0'

annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'
implementation 'com.timehop.stickyheadersrecyclerview:library:0.4.3'
implementation 'com.squareup:otto:1.3.8'
implementation 'com.vdurmont:emoji-java:3.3.0'
implementation 'com.google.android:flexbox:0.3.1'
implementation 'org.apache.commons:commons-lang3:3.5'
implementation 'com.github.barteksc:android-pdf-viewer:2.7.0'
implementation 'com.github.barteksc:pdfium-android:1.7.0'
implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
implementation "com.squareup.retrofit2:converter-gson:$retrofitVersion"
implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion"
implementation 'me.leolin:ShortcutBadger:1.1.21@aar'
implementation 'com.wang.avi:library:2.1.3'
implementation 'io.reactivex.rxjava2:rxjava:2.1.5'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'com.squareup.okhttp3:okhttp:3.8.1'
implementation 'com.squareup.okhttp3:logging-interceptor:3.8.0'
implementation 'com.google.code.gson:gson:2.8.0'
implementation "com.google.dagger:dagger-android:$daggerVersion"
implementation "com.google.dagger:dagger-android-support:$daggerVersion"
implementation "com.google.dagger:dagger:$daggerVersion"
implementation 'org.apache.commons:commons-lang3:3.6'
implementation('com.crashlytics.sdk.android:answers:1.4.2@aar') {
transitive = true
}

@surajsahani
Copy link

Change to these parameters in build.gradle, it worked for me using version butterknife:10.2.1

testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

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

@MohamedAboAdel
Copy link

I had exactly the same problem

I have made the following changes namely

implementation 'com.jakewharton:butterknife:9.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0'

to
implementation 'com.jakewharton:butterknife:10.2.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'

@JR-Asif
Copy link

JR-Asif commented Aug 3, 2021

changing the version worked to 10.2.1 worked for me. Thankyou.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants