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

Android X support #1280

Closed
xTheITx opened this Issue May 15, 2018 · 13 comments

Comments

@xTheITx

xTheITx commented May 15, 2018

I've recently attempted to upgrade a project which uses Butterknife v8.8.1 to make use of the new Android X libraries by using the jetifier tool in Android Studio.

The project fails to compile as the generated _ViewBinding classes reference the old android.support.annotation. annotations which no longer exist.
There may also be additional issues I'm not aware of.

I was just wondering if there was a plan to migrate over to reference the new androidx package names in the generated code.

I'm not familiar with the Butterknife code, but let me know if there's anything I could contribute to the project to facilitate adding support.

Thank you for your time

@scarrie

This comment has been minimized.

Show comment
Hide comment
@scarrie

scarrie May 18, 2018

I got my app compiling by adding my own copies of the old package "android.support.annotation"s for @callsuper and @UiThread.

@Retention(CLASS) @Target({METHOD,CONSTRUCTOR,TYPE,PARAMETER}) public @interface UiThread { }

@Retention(CLASS) @Target({METHOD}) public @interface CallSuper { }

Its a start, but then I hit further problems caused by this new jetifier process with other libraries. Guess we just have to be patient to wait for all these third party libraries to update.

scarrie commented May 18, 2018

I got my app compiling by adding my own copies of the old package "android.support.annotation"s for @callsuper and @UiThread.

@Retention(CLASS) @Target({METHOD,CONSTRUCTOR,TYPE,PARAMETER}) public @interface UiThread { }

@Retention(CLASS) @Target({METHOD}) public @interface CallSuper { }

Its a start, but then I hit further problems caused by this new jetifier process with other libraries. Guess we just have to be patient to wait for all these third party libraries to update.

@allidoiswarren

This comment has been minimized.

Show comment
Hide comment
@allidoiswarren

allidoiswarren Jun 6, 2018

I'll take a crack at this.

allidoiswarren commented Jun 6, 2018

I'll take a crack at this.

@JakeWharton

This comment has been minimized.

Show comment
Hide comment
@JakeWharton

JakeWharton Jun 14, 2018

Owner

Merged

Owner

JakeWharton commented Jun 14, 2018

Merged

@justinegeo96

This comment has been minimized.

Show comment
Hide comment
@justinegeo96

justinegeo96 Jun 22, 2018

I'm sorry to say the error still persists.

justinegeo96 commented Jun 22, 2018

I'm sorry to say the error still persists.

@naturalwarren

This comment has been minimized.

Show comment
Hide comment
@naturalwarren

naturalwarren Jun 22, 2018

Contributor

Can you paste the stack trace? Are you building against a JAR cut from master?

Contributor

naturalwarren commented Jun 22, 2018

Can you paste the stack trace? Are you building against a JAR cut from master?

@ArunPandiyan

This comment has been minimized.

Show comment
Hide comment
@ArunPandiyan

ArunPandiyan Jun 25, 2018

It's from the import statement for the annotations which is found in the auto generated viewbinding files.

ArunPandiyan commented Jun 25, 2018

It's from the import statement for the annotations which is found in the auto generated viewbinding files.

@k4dima

This comment has been minimized.

Show comment
Hide comment
@k4dima

k4dima Jul 1, 2018

repositories {
    maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
implementation 'com.jakewharton:butterknife:9.0.0-SNAPSHOT'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-SNAPSHOT'

k4dima commented Jul 1, 2018

repositories {
    maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
implementation 'com.jakewharton:butterknife:9.0.0-SNAPSHOT'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-SNAPSHOT'
@danielwilson1702

This comment has been minimized.

Show comment
Hide comment
@danielwilson1702

danielwilson1702 Aug 28, 2018

Um, in terms of production code how safe is this on a scale of 1-10 where 1="wtf are you doing this shouldn't be in the same room as a production app"

danielwilson1702 commented Aug 28, 2018

Um, in terms of production code how safe is this on a scale of 1-10 where 1="wtf are you doing this shouldn't be in the same room as a production app"

@feinstein

This comment has been minimized.

Show comment
Hide comment
@feinstein

feinstein Aug 28, 2018

repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
implementation 'com.jakewharton:butterknife:9.0.0-SNAPSHOT'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-SNAPSHOT'

This isn't working for me

feinstein commented Aug 28, 2018

repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
implementation 'com.jakewharton:butterknife:9.0.0-SNAPSHOT'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-SNAPSHOT'

This isn't working for me

@feinstein

This comment has been minimized.

Show comment
Hide comment
@feinstein

feinstein Aug 28, 2018

Ok, now it works, just be sure to put it inside the repositories inside allprojects and not the one inside buildscript

feinstein commented Aug 28, 2018

Ok, now it works, just be sure to put it inside the repositories inside allprojects and not the one inside buildscript

@adityathakar

This comment has been minimized.

Show comment
Hide comment
@adityathakar

adityathakar Sep 12, 2018

Is it safe to use 9.0.0-SNAPSHOT version in production code?

adityathakar commented Sep 12, 2018

Is it safe to use 9.0.0-SNAPSHOT version in production code?

@SyedNabil

This comment has been minimized.

Show comment
Hide comment
@SyedNabil

SyedNabil Sep 13, 2018

In case like me you are confused about the gradle settings, you can find the complete solution to this as a stack overflow answer: https://stackoverflow.com/a/52308912/10224384

SyedNabil commented Sep 13, 2018

In case like me you are confused about the gradle settings, you can find the complete solution to this as a stack overflow answer: https://stackoverflow.com/a/52308912/10224384

@kagile

This comment has been minimized.

Show comment
Hide comment
@kagile

kagile Oct 9, 2018

Please publish releases instead of snapshots or please leave a note. Shall I update README?

kagile commented Oct 9, 2018

Please publish releases instead of snapshots or please leave a note. Shall I update README?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment