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
The getApplicationDocumentsDirectory method is returning a path formatted as **/data/user/0**/com.example.app/app_flutter, which is causing a failure in a plugin that expects a path in the format of **/data/data/**com.example.app/app_flutter.
I created Download directory under /data/user/0**/com.example.app/app_flutter
D/DownloadWorker(10806): Update notification: {notificationId: 22, title: image.jpg, status: FAILED, progress: -1}
W/System.err(10806): java.lang.IllegalArgumentException: Failed to find configured root that contains /data/data/com.example.app/app_flutter/Download/image.jpg
W/System.err(10806): at androidx.core.content.FileProvider$SimplePathStrategy.getUriForFile(FileProvider.java:825)
W/System.err(10806): at androidx.core.content.FileProvider.getUriForFile(FileProvider.java:450)
W/System.err(10806): at vn.hunghd.flutterdownloader.IntentUtils.buildIntent(IntentUtils.kt:19)
W/System.err(10806): at vn.hunghd.flutterdownloader.IntentUtils.validatedFileIntent(IntentUtils.kt:36)
W/System.err(10806): at vn.hunghd.flutterdownloader.DownloadWorker.downloadFile(DownloadWorker.kt:446)
W/System.err(10806): at vn.hunghd.flutterdownloader.DownloadWorker.doWork(DownloadWorker.kt:206)
W/System.err(10806): at androidx.work.Worker$1.run(Worker.java:86)
W/System.err(10806): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
W/System.err(10806): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
W/System.err(10806): at java.lang.Thread.run(Thread.java:1012)
** UPDATE **
I learned that '/data/user/0' is a symlink to '/data/data' directory. Changed the bug title to "IllegalArgumentException from ItentUtils.buildIntent in downloadFile method."
Expected behavior
Downloads must be completed successfully, and files should be correctly saved in the **/data/user/0**/com.example.app/app_flutter/Download directory without any errors.
Device information:
Device: Emulator (Pixel 7 Pro API 33)
OS: Android 13
plugin version 1.11.5
The text was updated successfully, but these errors were encountered:
claptv
changed the title
Path Mismatch in getApplicationDocumentsDirectory Usage on Android 13
IllegalArgumentException from ItentUtils.buildIntent in downloadFile method
Nov 30, 2023
The getApplicationDocumentsDirectory method is returning a path formatted as
**/data/user/0**/com.example.app/app_flutter
, which is causing a failure in a plugin that expects a path in the format of**/data/data/**com.example.app/app_flutter
.I created
Download
directory under/data/user/0**/com.example.app/app_flutter
D/DownloadWorker(10806): Update notification: {notificationId: 22, title: image.jpg, status: FAILED, progress: -1}
W/System.err(10806): java.lang.IllegalArgumentException: Failed to find configured root that contains /data/data/com.example.app/app_flutter/Download/image.jpg
W/System.err(10806): at androidx.core.content.FileProvider$SimplePathStrategy.getUriForFile(FileProvider.java:825)
W/System.err(10806): at androidx.core.content.FileProvider.getUriForFile(FileProvider.java:450)
W/System.err(10806): at vn.hunghd.flutterdownloader.IntentUtils.buildIntent(IntentUtils.kt:19)
W/System.err(10806): at vn.hunghd.flutterdownloader.IntentUtils.validatedFileIntent(IntentUtils.kt:36)
W/System.err(10806): at vn.hunghd.flutterdownloader.DownloadWorker.downloadFile(DownloadWorker.kt:446)
W/System.err(10806): at vn.hunghd.flutterdownloader.DownloadWorker.doWork(DownloadWorker.kt:206)
W/System.err(10806): at androidx.work.Worker$1.run(Worker.java:86)
W/System.err(10806): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
W/System.err(10806): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
W/System.err(10806): at java.lang.Thread.run(Thread.java:1012)
** UPDATE **
I learned that '/data/user/0' is a symlink to '/data/data' directory. Changed the bug title to "IllegalArgumentException from ItentUtils.buildIntent in downloadFile method."
Expected behavior
Downloads must be completed successfully, and files should be correctly saved in the
**/data/user/0**/com.example.app/app_flutter/Download
directory without any errors.Device information:
The text was updated successfully, but these errors were encountered: