fresco: 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

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 3
  • Comments: 22 (1 by maintainers)

Most upvoted comments

These warnings still exists in 2.5.0.

These warnings still exists in 2.6.0.

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.

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 `

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