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

4.13 version load avif image fail #4751

Closed
wangxuyang518 opened this issue Feb 22, 2022 · 7 comments
Closed

4.13 version load avif image fail #4751

wangxuyang518 opened this issue Feb 22, 2022 · 7 comments
Labels

Comments

@wangxuyang518
Copy link

    implementation 'com.github.bumptech.glide:glide:4.13.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.13.0'

url:
https://dhfs-test-cpc.wanyol.com/2021/12/31/bc3f21e101db91fc4de53dcb18f034f1.jpg?x-oss-process=image/resize,m_fill,h_2340,w_1080/quality,Q_60/format,avif

 Glide.with(AvifGlideActivity.this)
                    .load("https://dhfs-test-cpc.wanyol.com/2021/12/31/bc3f21e101db91fc4de53dcb18f034f1.jpg?x-oss-process=image/resize,m_fill,h_2340,w_1080/quality,Q_60/format,avif")
                    .error(R.mipmap.ic_launcher)
                    .into(mImage);

log:

com.bumptech.glide.load.resource.bitmap.VideoDecoder$VideoDecoderException: MediaMetadataRetriever failed to retrieve a frame without throwing, check the adb logs for .*MetadataRetriever.* prior to this exception for details
@sjudd
Copy link
Collaborator

sjudd commented Feb 22, 2022

Did you try following the instructions here? https://bumptech.github.io/glide/int/avif.html

@msisuzney
Copy link

@sjudd It seems that you forgot to add "annotationProcessor project(':annotation:compiler')" to dependencies in https://github.com/bumptech/glide/blob/master/integration/avif/build.gradle ,annotation processor cannot find AvifGlideModule class when gradle complie the project.

@sjudd sjudd added the bug label Feb 23, 2022
@sjudd
Copy link
Collaborator

sjudd commented Feb 23, 2022

Internal bug is b/221073978

copybara-service bot pushed a commit that referenced this issue Feb 23, 2022
Without this, the annotation processor won't be able to find the
AvifGlideModule.

Fixes github issue #4751

PiperOrigin-RevId: 430480978
copybara-service bot pushed a commit that referenced this issue Feb 23, 2022
Without this, the annotation processor won't be able to find the
AvifGlideModule.

Fixes github issue #4751

PiperOrigin-RevId: 430480978
copybara-service bot pushed a commit that referenced this issue Feb 23, 2022
Without this, the annotation processor won't be able to find the
AvifGlideModule.

Fixes github issue #4751

PiperOrigin-RevId: 430490297
sjudd pushed a commit to sjudd/glide that referenced this issue Feb 23, 2022
Without this, the annotation processor won't be able to find the
AvifGlideModule.

Fixes github issue bumptech#4751

PiperOrigin-RevId: 430490297
@sjudd sjudd closed this as completed Feb 23, 2022
@vigneshvg
Copy link
Contributor

I just verified that this has been fixed in 4.13.1.

@wangxuyang518 and @msisuzney please feel free to open another issue if you run into any other issues with the AVIF integration.

vigneshvg added a commit to vigneshvg/glide that referenced this issue Feb 23, 2022
4.13.0 was missing an annotationProcessor depdendency causing it
to not include the AvifGlideModule correctly (Issue bumptech#4751).

4.13.1 fixes that issue and should be the preferred version
for public documentation.
sjudd pushed a commit that referenced this issue Feb 23, 2022
4.13.0 was missing an annotationProcessor depdendency causing it
to not include the AvifGlideModule correctly (Issue #4751).

4.13.1 fixes that issue and should be the preferred version
for public documentation.
@tronku
Copy link

tronku commented Mar 12, 2022

@vigneshvg somehow this commit introduces a runtime crash,
JNI DETECTED ERROR IN APPLICATION: JNI GetFieldID called with pending exception java.lang.NoSuchFieldError: no "I" field "width" in class "Lorg/aomedia/avif/android/AvifDecoder$Info;" or its superclasses

@vigneshvg
Copy link
Contributor

@vigneshvg somehow this commit introduces a runtime crash, JNI DETECTED ERROR IN APPLICATION: JNI GetFieldID called with pending exception java.lang.NoSuchFieldError: no "I" field "width" in class "Lorg/aomedia/avif/android/AvifDecoder$Info;" or its superclasses

Thanks for reporting this. I have a few questions.

  • Can you share a bit more information on how you are building the app that results in this error? From what i see, if you are using the gradle build system, it should pick up the JNI dependencies automatically and this error should not happen.
  • Also, do you see anything else on the stack trace related to the JNI load? Specifically, libavif's JNI wrapper should log an error message if it is unable to load the native library: https://github.com/AOMediaCodec/libavif/blob/master/android_jni/avifandroidjni/src/main/java/org/aomedia/avif/android/AvifDecoder.java#L16
  • Which device/ABI is this running on? If it happens to be on an emulator, emulators are known to be a bit flaky with handling JNI, so i would recommend trying it on a real device.

@vigneshvg
Copy link
Contributor

@tronku like you mentioned in #4761, it could likely be a proguard issue. i will look into it.

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

No branches or pull requests

5 participants