Huawei phone crash when trying to use mediaLibrary

Please provide the following:

  1. SDK Version: 44
  2. Platforms(Android/iOS/web/all): Android
  3. Add the appropriate “Tag” based on what Expo library you have a question on.

Hello community ,
when I try to use MediaLibrary with Huawei phone , the App crash with a fatal error , when I try to debug in Android studio , that’s the error I got

2022-04-14 14:01:47.842 7680-7795/? E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #2
Process: com.imaxeam.maxapps, PID: 7680
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:355)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
at java.util.concurrent.FutureTask.run(FutureTask.java:271)
at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:784)
Caused by: java.lang.IncompatibleClassChangeError: Class ‘android.media.MediaMetadataRetriever’ does not implement interface ‘java.lang.AutoCloseable’ in call to ‘void java.lang.AutoCloseable.close()’ (declaration of ‘kotlin.n0.a’ appears in base.apk!classes5.dex)
at kotlin.n0.a.a(AutoCloseable.kt:1)
at expo.modules.medialibrary.assets.AssetUtilsKt.getAssetDimensionsFromCursor(AssetUtils.kt:9)
at expo.modules.medialibrary.assets.AssetUtilsKt.putAssetsInfo(AssetUtils.kt:18)
at expo.modules.medialibrary.assets.GetAssets.doInBackground(GetAssets.kt:11)
at expo.modules.medialibrary.assets.GetAssets.doInBackground(GetAssets.kt:1)
at android.os.AsyncTask$2.call(AsyncTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:784)

Hey @maxappsimaxeam, could you create a Github Issue for this with all the relevant information including OS version, the device model, etc. As well as a reproducible, public repo that showcases the crash. (For instance, what exactly are you doing with the MediaLibrary module that causes the crash)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.