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

Ouestion about some code . #167

Closed
mohammadne opened this issue Nov 9, 2019 · 4 comments
Closed

Ouestion about some code . #167

mohammadne opened this issue Nov 9, 2019 · 4 comments

Comments

@mohammadne
Copy link

in my app when I start to download an audio I get this:

D/skia    (17160): --- SkAndroidCodec::NewFromStream returned null
W/System.err(17160): java.lang.IllegalArgumentException: Couldn't find meta-data for provider with authority com.gerama.flutter_downloader.provider
W/System.err(17160): 	at androidx.core.content.FileProvider.parsePathStrategy(FileProvider.java:606)
W/System.err(17160): 	at androidx.core.content.FileProvider.getPathStrategy(FileProvider.java:579)
W/System.err(17160): 	at androidx.core.content.FileProvider.getUriForFile(FileProvider.java:417)
W/System.err(17160): 	at vn.hunghd.flutterdownloader.IntentUtils.buildIntent(IntentUtils.java:23)
W/System.err(17160): 	at vn.hunghd.flutterdownloader.IntentUtils.validatedFileIntent(IntentUtils.java:35)
W/System.err(17160): 	at vn.hunghd.flutterdownloader.DownloadWorker.downloadFile(DownloadWorker.java:360)
W/System.err(17160): 	at vn.hunghd.flutterdownloader.DownloadWorker.doWork(DownloadWorker.java:189)
W/System.err(17160): 	at androidx.work.Worker$1.run(Worker.java:85)
W/System.err(17160): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
W/System.err(17160): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
W/System.err(17160): 	at java.lang.Thread.run(Thread.java:764)
I/WM-WorkerWrapper(17160): Worker result FAILURE for Work [ id=57594553-10eb-4737-a3c9-02cecbb8455d, tags={ flutter_download_task, vn.hunghd.flutterdownloader.DownloadWorker } ]
D/skia    (17160): --- SkAndroidCodec::NewFromStream returned null
I/chatty  (17160): uid=10128(com.gerama) pool-1-thread-3 identical 4 lines
D/skia    (17160): --- SkAndroidCodec::NewFromStream returned null
D/skia    (17160): --- SkAndroidCodec::NewFromStream returned null
I/chatty  (17160): uid=10128(com.gerama) pool-1-thread-3 identical 1 line
D/skia    (17160): --- SkAndroidCodec::NewFromStream returned null
W/System.err(17160): java.lang.IllegalArgumentException: Couldn't find meta-data for provider with authority com.gerama.flutter_downloader.provider
W/System.err(17160): 	at androidx.core.content.FileProvider.parsePathStrategy(FileProvider.java:606)
W/System.err(17160): 	at androidx.core.content.FileProvider.getPathStrategy(FileProvider.java:579)
W/System.err(17160): 	at androidx.core.content.FileProvider.getUriForFile(FileProvider.java:417)
W/System.err(17160): 	at vn.hunghd.flutterdownloader.IntentUtils.buildIntent(IntentUtils.java:23)
W/System.err(17160): 	at vn.hunghd.flutterdownloader.IntentUtils.validatedFileIntent(IntentUtils.java:35)
W/System.err(17160): 	at vn.hunghd.flutterdownloader.DownloadWorker.downloadFile(DownloadWorker.java:360)
W/System.err(17160): 	at vn.hunghd.flutterdownloader.DownloadWorker.doWork(DownloadWorker.java:189)
W/System.err(17160): 	at androidx.work.Worker$1.run(Worker.java:85)
W/System.err(17160): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
W/System.err(17160): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
W/System.err(17160): 	at java.lang.Thread.run(Thread.java:764)
I/WM-WorkerWrapper(17160): Worker result FAILURE for Work [ id=c5e9fe33-84ad-47d8-9494-d68811edfc19, tags={ flutter_download_task, vn.hunghd.flutterdownloader.DownloadWorker } ]

do you know what is the problem ?
what should I do ?

@hnvn
Copy link
Member

hnvn commented Nov 9, 2019

You miss this snip codes in your manifest:

<provider
     android:name="vn.hunghd.flutterdownloader.DownloadedFileProvider"
     android:authorities="${applicationId}.flutter_downloader.provider"
     android:exported="false"
     android:grantUriPermissions="true">
      <meta-data
          android:name="android.support.FILE_PROVIDER_PATHS"
          android:resource="@xml/provider_paths"/>
</provider>

@mohammadne
Copy link
Author

oh yes , thanks for fast response.
also I want to change the saved file name pattern .
how Can I achive it.

@mohammadne
Copy link
Author

mohammadne commented Nov 9, 2019

for example I want to save my mp3 file on storage without .mp3 name and instead of title of file , I want to add and delete some characters of it .
my purpose is to access this file only throw my application .
Thanks alot.

@hnvn
Copy link
Member

hnvn commented Nov 9, 2019

If you want to prevent other applications from accessing your files, you should save them into the internal storage. See detail here

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

2 participants