Fresco: AnimatedImage not found

Created on 24 Nov 2018  路  8Comments  路  Source: facebook/fresco

Description

I'm facing Java compilation error because it is unable to find AnimatedImage & AnimatedImageDecoder interfaces/classes. The issue occurs in WebPImage class. When I open the WebPImage class, it shows that the whole "base" package is missing. Weird part is it was working till yesterday and I've done no changes to the code or my system.

---This is the issue
webpimageissue_fresco_nov24_2018

---This is WebPImage class
webpimageclass_fresco_nov24_2018

I also tried to invalidate caches & restart option from Android Studio but it didn't work. I even created a new project and moved the code one-file-at-a-time to fix the issue, didn't work either.

Reproduction

Use the Fresco libraries (tried 1.9.0 to 1.11.0) in the Android project.
Try to initialize WebPImage.
Build the project.

Additional Information

  • Android (minSdkVersion: 16, compileSdkVersion: 28)
  • Fresco version: 1.11.0
  • Fresco WebPSupport: 1.11.0
  • Fresco Animated-WebP: 1.11.0
  • Platform version: Android 5.1 (Moto G)
  • Android Studio: 3.4 Canary 4
  • Instant Run: Disabled
  • Gradle: 3.4.0-alpha04 (com.android.tools.build)
  • Gradle Wrapper: 5.0 milestone-1
build

All 8 comments

Solution

In the project gradle file, changed the gradle version to:
classpath 'com.android.tools.build:gradle:3.2.1'

And changed the gradle wrapper to:
gradle-4.10.1

After trial and error, I stumbled onto this configuration and it worked. I'm not sure why it didn't because it was working until yesterday evening with the gradle alpha versions.

Thanks for investigating @ojhariddhish. Looks like a bug in the Gradle version. Let us know if you experience this issue again.

Experiencing this on:

  • instant run enabled/included in project (only if this is enabled!)
  • fresco 1.12.1
  • gradle 5.1.1
  • gradle plugin 3.3.1
  • AS 3.3 / 3.5 Canary 4

Full stacktrace:

> Task :app:compileDebugJavaWithJavac FAILED
C:\Users\carst\Documents\git\privat\thinking-stickers\app\src\main\java\de\chagemann\thinkingstickers\StickerPackValidator.java:134: error: cannot access AnimatedImage
                final WebPImage webPImage = WebPImage.create(bytes);
                                                     ^
  class file for com.facebook.imagepipeline.animated.base.AnimatedImage not found
C:\Users\carst\Documents\git\privat\thinking-stickers\app\src\main\java\de\chagemann\thinkingstickers\StickerPackValidator.java:135: error: cannot access AnimatedImageDecoder
                if (webPImage.getHeight() != IMAGE_HEIGHT) {
                             ^
  class file for com.facebook.imagepipeline.animated.factory.AnimatedImageDecoder not found
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors

See also https://github.com/WhatsApp/stickers/issues/293

Could you perhaps report this upstream at gradle/the gradle plugin, please?

Works with gradle 4.10.1and gradle plugin 3.3.1.

I have the same problem . I don't know the exact cause of this problem.

add one more dependency

implementation 'com.facebook.fresco:animated-base:1.13.0'

I have the same problem . I don't know the exact cause of this problem.

add one more dependency

implementation 'com.facebook.fresco:animated-base:1.13.0'

Solution

In the project gradle file, changed the gradle version to:
classpath 'com.android.tools.build:gradle:3.2.1'

And changed the gradle wrapper to:
gradle-4.10.1

After trial and error, I stumbled onto this configuration and it worked. I'm not sure why it didn't because it was working until yesterday evening with the gradle alpha versions.

add one more dependency

implementation 'com.facebook.fresco:animated-base:1.13.0'

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kingty picture kingty  路  4Comments

eldk picture eldk  路  3Comments

eresid picture eresid  路  4Comments

liubaoyua picture liubaoyua  路  3Comments

hanhmh1203 picture hanhmh1203  路  4Comments