fresco icon indicating copy to clipboard operation
fresco copied to clipboard

Spurious build warnings on "com.facebook.infer.annotation.Nullsafe$Mode not found"

Open kenyee opened this issue 3 years ago • 22 comments

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

kenyee avatar Apr 26 '21 13:04 kenyee

Thanks for noticing, we're working on a fix.

wizh avatar Apr 29 '21 10:04 wizh

These warnings still exists in 2.5.0.

hmmh-michael-schaefer avatar Jul 30 '21 10:07 hmmh-michael-schaefer

When will this problem be fixed?

xfx761 avatar Sep 09 '21 01:09 xfx761

Can this problem be fixed soon?

SouravKB avatar Sep 20 '21 17:09 SouravKB

I tried to solve this problem by adding the following dependencies implementation 'com.facebook.infer.annotation:infer-annotation:0.18.0'

xfx761 avatar Sep 23 '21 06:09 xfx761

I tried to solve this problem by adding the following dependencies implementation 'com.facebook.infer.annotation:infer-annotation:0.18.0'

xfx761 avatar Sep 23 '21 06:09 xfx761

@yuxia761 did that work?

kenyee avatar Oct 18 '21 19:10 kenyee

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).

sir4gt10 avatar Oct 19 '21 13:10 sir4gt10

These warnings still exists in 2.6.0.

henrychao24 avatar Nov 18 '21 02:11 henrychao24

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.

stale[bot] avatar Jan 09 '22 04:01 stale[bot]

This is still a bug and I can't add the label to tag it as such 😔

kenyee avatar Jan 09 '22 18:01 kenyee

yeah,it has happend in my project!It is only a warn!

cuibg avatar Jan 13 '22 02:01 cuibg

Still happening

josephTheCut avatar Feb 15 '22 23:02 josephTheCut

can it get some errors in running time ?

cuibg avatar Feb 16 '22 02:02 cuibg

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 `

axitasavani avatar Apr 27 '22 09:04 axitasavani

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 avatar Apr 27 '22 10:04 eartle

@eartle , thank you, the warnings are disappears in Logcat

Lampotrias avatar Apr 27 '22 15:04 Lampotrias

Also, this could be fixed in fresco by declaring infer as a compileOnlyApi dependency as described here

eartle avatar Apr 27 '22 16:04 eartle

@eartle i believe that using implementation is better than compileOnly

cuibg avatar Apr 28 '22 02:04 cuibg

@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 avatar Apr 28 '22 09:04 eartle

@eartle ok,thank you!

cuibg avatar Apr 28 '22 09:04 cuibg

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.

SurajBahadur avatar May 03 '22 09:05 SurajBahadur