fresco
fresco copied to clipboard
Spurious build warnings on "com.facebook.infer.annotation.Nullsafe$Mode not found"
Description
We updated from Fresco 2.3.0 to 2.4.0 and now we get these warnings in every module that uses Fresco:
com.facebook.infer.annotation.Nullsafe$Mode not found
warning: unknown enum constant Mode.LOCAL
warning: unknown enum constant Mode.STRICT
From gradle app:dependencies, the only thing that uses infer in our project is Fresco:
| | | | +--- com.facebook.fresco:fresco:2.4.0
| | | | | +--- com.facebook.fresco:fbcore:2.4.0
| | | | | +--- com.facebook.fresco:drawee:2.4.0
| | | | | | +--- com.facebook.fresco:fbcore:2.4.0
| | | | | | +--- com.facebook.fresco:imagepipeline:2.4.0
| | | | | | | +--- com.facebook.fresco:imagepipeline-base:2.4.0
| | | | | | | | +--- com.facebook.infer.annotation:infer-annotation:0.18.0
| | | | | | | | | +--- com.google.code.findbugs:jsr305:3.0.1 -> 3.0.2
| | | | | | | | | \--- org.jetbrains.kotlin:kotlin-annotations-jvm:1.3.72 -> 1.4.32
| | | | | | | | +--- com.facebook.soloader:annotation:0.9.0
| | | | | | | | +--- com.parse.bolts:bolts-tasks:1.4.0
| | | | | | | | \--- com.facebook.fresco:fbcore:2.4.0
| | | | | | | +--- com.facebook.soloader:nativeloader:0.9.0
| | | | | | | +--- com.facebook.soloader:annotation:0.9.0
| | | | | | | +--- com.parse.bolts:bolts-tasks:1.4.0
| | | | | | | \--- com.facebook.fresco:fbcore:2.4.0
Reproduction
Update to 2.4.0...build project
Solution
Doesn't seem harmful but might confuse users...can roll back to Fresco 2.3.0 if you want to avoid these spurious warnings
Additional Information
- Fresco version: 2.4.0
- Platform version: Gradle 6.8.3, AGP 4.1.3
Thanks for noticing, we're working on a fix.
These warnings still exists in 2.5.0.
When will this problem be fixed?
Can this problem be fixed soon?
I tried to solve this problem by adding the following dependencies
implementation 'com.facebook.infer.annotation:infer-annotation:0.18.0'
I tried to solve this problem by adding the following dependencies
implementation 'com.facebook.infer.annotation:infer-annotation:0.18.0'
@yuxia761 did that work?
I tried to solve this problem by adding the following dependencies
implementation 'com.facebook.infer.annotation:infer-annotation:0.18.0'
That doesn't work for me while using v2.5.0. Compiling failed (FrescoCacheEventListener).
These warnings still exists in 2.6.0.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "bug" or "enhancement" and I will leave it open. Thank you for your contributions.
This is still a bug and I can't add the label to tag it as such 😔
yeah,it has happend in my project!It is only a warn!
Still happening
can it get some errors in running time ?
i m facing the same warning.
`warning: unknown enum constant Mode.STRICT reason: class file for com.facebook.infer.annotation.Nullsafe$Mode not found warning: unknown enum constant Mode.LOCAL unknown enum constant Mode.STRICT
unknown enum constant Mode.LOCAL
warning: unknown enum constant Mode.STRICT unknown enum constant Mode.STRICT
reason: class file for com.facebook.infer.annotation.Nullsafe$Mode not found warning: unknown enum constant Mode.LOCAL unknown enum constant Mode.LOCAL
warning: unknown enum constant Mode.STRICT reason: class file for com.facebook.infer.annotation.Nullsafe$Mode not found warning: unknown enum constant Mode.LOCAL unknown enum constant Mode.STRICT
unknown enum constant Mode.LOCAL
warning: unknown enum constant Mode.STRICT reason: class file for com.facebook.infer.annotation.Nullsafe$Mode not found unknown enum constant Mode.STRICT
warning: unknown enum constant Mode.LOCAL unknown enum constant Mode.LOCAL
warning: unknown enum constant Mode.LOCAL warning: unknown enum constant Mode.LOCAL warning: unknown enum constant Mode.LOCAL warning: unknown enum constant Mode.LOCAL `
Hello, friends! And happy anniversary to this bug!
So I found that the problem is that fresco declares its dependency on the infer annotations library as compileOnly. To remove the warnings you can also add the infer library as compileOnly to your build.gradle as below.
compileOnly "com.facebook.infer.annotation:infer-annotation:0.18.0"
Hope this helps. And here's to a clean build output.
@eartle , thank you, the warnings are disappears in Logcat
Also, this could be fixed in fresco by declaring infer as a compileOnlyApi
dependency as described here
@eartle i believe that using implementation is better than compileOnly!
@cuibg I'm no expert on Infer, but it looks like it's a static analysis tool and therefore its annotations aren't required at runtime. This is why fresco doesn't include them at runtime and you don't need to either, but there's probably no harm in it if that's what you want to do.
@eartle ok,thank you!
This warning is exist while building release build with com.facebook.fresco:fresco:2.5.0
and but after downgrading the version to com.facebook.fresco:fresco:2.4.0
working fine.