Skip to content
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

"ClassNotFoundException: androidx.exifinterface.media.ExifInterface" only on some devices #2810

Open
pdalfarr opened this issue Nov 8, 2024 · 0 comments

Comments

@pdalfarr
Copy link

pdalfarr commented Nov 8, 2024

Description

Recently I start to receive some bug report for some of my apps regarding a missing androidx.exifinterface.media.ExifInterface class.

The odd thing is that this seems only to happens for some specific devices.

I think this exception occurs at Android Fresco 's pipeline initialization phase, i.e. Fresco.initialize(...)

A. Trying to solve the problem in blind mode - does not work :/

As I don't really know what's going on, I did the following changes in my gradle config:

  1. In my /gradle/libs.versions.toml have added

    [versions]
    exifinterface = "1.3.7"
    ...
    [libraries]
    androidx-exifinterface = { module = "androidx.exifinterface:exifinterface", version.ref = "exifinterface" }
    
  2. and also added ,in the build.gradle file of my library project, this:

    api libs.androidx.exifinterface
    

B. Maybe using R8/Proguard

Not sure.. and which Proguard statements should I use ..??

Something like this :

-keep class androidx.exifinterface.media.ExifInterface { *; }
-keepclassmembers class androidx.exifinterface.media.ExifInterface { *; }

C. Begging for help

  • Did any of you encountered this issue?
  • If yes, how did you solved it?

Note:

FYI, the stack trace, which occurs in the "FrescoIoBoundExecutor" thread

java.lang.ClassNotFoundException: androidx.exifinterface.media.ExifInterface
 [wrapped] java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/exifinterface/media/ExifInterface;
        at c6.b.a(b.java:8)
        at v5.f.l(f.java:482)
        at com.facebook.imagepipeline.producers.LocalFetchProducer.d(LocalFetchProducer.java:162)
        at com.facebook.imagepipeline.producers.SwallowResultProducer.run(SwallowResultProducer.java:12)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at com.google.android.material.datepicker.DateFormatTextWatcher.lambda$new$0(DateFormatTextWatcher.java:72)
        at androidx.activity.ComponentActivity$onBackPressedDispatcher$2$$ExternalSyntheticLambda1.run(ComponentActivity.java:0)
        at java.lang.Thread.run(Thread.java:919)

Reproduction

According to bug report, I can confirm that the issue does happen on Samsung SM-T595 gta2xllte Android 10
I cannot reproduce on my side: I do not have this hardware.

Solution

Maybe Proguard / R8 rule could help.. or not?

Additional Information

  • Fresco version:
    fresco = "3.2.0"
    api libs.fresco
    api libs.fresco.animated.webp
    api libs.fresco.webpsupport
    api libs.fresco.animated.gif

  • Platform version: Samsung SM-T595 gta2xllte Android 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant