You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[imagepicker] Exception if built in --release mode: Error: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/documentfile/provider/DocumentFile;#554
Open
boutier opened this issue
Dec 5, 2023
· 3 comments
I have updated Imagepicker on its latest version (3.0.0 / 3.0.1). It worked well in dev mode, but when built with the --release flag, it cease to work.
I patched webpack to re-enable logs in release mode (drop_console: false), and get this one.
JS: CONSOLE ERROR: on select image Error: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/documentfile/provider/DocumentFile; getOrSetHelper(file:///data/data/appid/files/app/vendor.js:2:118868)
JS: at getFile(file:///data/data/appid/files/app/vendor.js:2:128579)
JS: at fromPath(file:///data/data/appid/files/app/vendor.js:2:139398)
JS: at handle(file:///data/data/appid/files/app/vendor.js:2:840987)
JS: at onResult(file:///data/data/appid/files/app/vendor.js:2:842335)
JS: at invokeTask(file:///data/data/appid/files/app/vendor.js:2:1240087)
JS: at onInvokeTask(file:///data/data/appid/files/app/vendor.js:2:1553242)
JS: at invokeTask(file:///data/data/appid/files/app/vendor.js:2:1240008)
JS: at runTask(file:///data/data/appid/files/app/vendor.js:2:1235405)
JS: at invokeTask(file:///data/data/appid/files/app/vendor.js:2:1241184)
JS: at ZoneTask.i.useG.invoke(file:///data/data/appid/files/app/vendor.js:...
Investigation
So I have extracted and compared the 2 produced APK. Here are some differences that looks suspicious to me in the META-INF directory.
Files that does not appear in --release
androidx.cardview_cardview.version
androidx.coordinatorlayout_coordinatorlayout.version
androidx.documentfile_documentfile.version # <-- at least this one seems missing for bad reasons
androidx.dynamicanimation_dynamicanimation.version
androidx.legacy_legacy-support-core-utils.version
androidx.localbroadcastmanager_localbroadcastmanager.version
androidx.print_print.version
com.google.android.material_material.version
(These files does not have corresponding entries in MANIFEST.MF.)
For files that exists in both side, versions does not match
androidx.customview_customview.version has content 1.1.0 in "dev" and 1.0.0 in "release". androidx.drawerlayout_drawerlayout.version has content 1.1.1 in "dev" and 1.0.0 in "release".
(I first thought it was a permission problem, that's why I have here the old *_EXTERNAL_STORAGE and requestLegacyExternalStorage but I don't think it changed anything. I should probably just revert this!)
Question
I don't really know how these files are generated and what I should try to go forward at this point. Any help appreciated! :-)
The text was updated successfully, but these errors were encountered:
@boutier I ended up working around this my following the alterations on this page by adding the following to the dependencies in the gradle file. implementation("androidx.documentfile:documentfile:1.0.1")
I admit that I din't found time to dig around this. But I really would like to understand why the versions differ between dev and release mode, and why dependencies are dropped. Maybe is it a more general issue, though: as I mainly test my code with the dev mode… I'm quite afraid about facing unexpected behaviors in prod (release)!
Hello,
Issue
I have updated
Imagepicker
on its latest version (3.0.0
/3.0.1
). It worked well in dev mode, but when built with the--release
flag, it cease to work.I patched webpack to re-enable logs in release mode (
drop_console: false
), and get this one.Investigation
So I have extracted and compared the 2 produced APK. Here are some differences that looks suspicious to me in the
META-INF
directory.--release
(These files does not have corresponding entries in
MANIFEST.MF
.)androidx.customview_customview.version
has content1.1.0
in "dev" and1.0.0
in "release".androidx.drawerlayout_drawerlayout.version
has content1.1.1
in "dev" and1.0.0
in "release".Other informations
Here are some other informations about my config:
package.json
extractsapp.gradle
AndroidManifest.xml
extracts(I first thought it was a permission problem, that's why I have here the old
*_EXTERNAL_STORAGE
andrequestLegacyExternalStorage
but I don't think it changed anything. I should probably just revert this!)Question
I don't really know how these files are generated and what I should try to go forward at this point. Any help appreciated! :-)
The text was updated successfully, but these errors were encountered: