-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
How to configure ACRA Dialog in Android Gradle Plugin v5 compatible way? #810
Comments
The future Android Gradle Plugin v5 will apparently generate non-final resource references, which makes them unsuitable for use in switch statements The recommended transformation is to chained-if statements: https://issuetracker.google.com/issues/159878591#comment13 Usage of resource references in annotations is a similar problem but does not have a recommended transformation yet. I logged upstream issue: ACRA/acra#810
The future Android Gradle Plugin v5 will apparently generate non-final resource references, which makes them unsuitable for use in switch statements The recommended transformation is to chained-if statements: https://issuetracker.google.com/issues/159878591#comment13 Usage of resource references in annotations is a similar problem but does not have a recommended transformation yet. I logged upstream issue: ACRA/acra#810
ugh. I'll probably just opt for deprecating the annotation configuration in favor of an improved kotlin dsl/java builder. |
As a library consumer the configuration by annotation is interesting but I don't mind having to configure an object with a builder On the plus side, it's deprecation for a future version and the deprecation warning was added just days ago. I'm just suppressing lint right now (we normally abort on deprecation so we're forced to proactively suppress and then track them honestly in our issue tracker) |
The future Android Gradle Plugin v5 will apparently generate non-final resource references, which makes them unsuitable for use in switch statements The recommended transformation is to chained-if statements: https://issuetracker.google.com/issues/159878591#comment13 Usage of resource references in annotations is a similar problem but does not have a recommended transformation yet. I logged upstream issue: ACRA/acra#810
This is much impacted as i have large old kotlin project which half of its classes uses butterknife, its in a point where i couldn't change the style of stop using R value where the constant values required |
Required reading
https://github.com/ACRA/acra/wiki/How-to-debug-ACRA
Describe the bug
The annotation style of configuring ACRA recommends using annotations set to 'R' values, but Android Gradle Plugin v5 will apparently have non-constant 'R' values, meaning a different style is needed
For instance, this will throw a new deprecation warning:
It is a new deprecation in Android Gradle Plugin 4.1
It may be suppressed temporarily like so:
In a similar context in Java, the recommendation is to alter code from switch with cases using the 'R' values (which I suppose must be constant to work in case statements?) to chained if: https://issuetracker.google.com/issues/159878591#comment13
But I'm not sure what transformation to use for annotations. In the connected issue where Butterknife (which also takes config as annotations that use R values) they simply say "don't use Butterknife", so that's not helpful.
Perhaps a switch to specifying the name of the resource, then ACRA does the id lookup and uses it? https://developer.android.com/reference/android/content/res/Resources.html#getIdentifier(java.lang.String,%20java.lang.String,%20java.lang.String)
Expected behavior
No deprecation warnings with recommended initialization style
Version
The text was updated successfully, but these errors were encountered: