Your workflow is unique 👨‍💻 -  tell us how you use Dropbox here.

Forum Discussion

ori's avatar
ori
Explorer | Level 3
8 years ago

FileUriExposedException

Hi

    Dropbox crashes. (dump is at the end of this question)

 

I have an app that I had developed for myself.

It used to work with Dropbox untill recently.

 

I am storing my myfile.or1 on dropbox and

in my app I am using intent-filter to call my app to read it.

 

I am not using dropbox API.

I did not move to 24 - my targetSdkVersion is 23
My app works fine if I access myfile.or1 from ES file browser.

Any idea?

 

Thanks Ori

 

I am adding the complete exception message:


03-01 09:44:46.670 7871-7871/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.dropbox.android, PID: 7871
android.os.FileUriExposedException: file:///storage/emulated/0/Android/data/com_dropbox_android/files/u7110502/scratch/ori/Notes/Amazon.or1 exposed beyond app through Intent.getData()
at android.os.StrictMode.onFileUriExposed(StrictMode.java:1799)
at android.net.Uri.checkFileUriExposed(Uri.java:2346)
at android.content.Intent.prepareToLeaveProcess(Intent.java:8933)
at android.content.Intent.prepareToLeaveProcess(Intent.java:8906)
at android.content.Intent.prepareToLeaveProcess(Intent.java:8894)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1690)
at android.app.ContextImpl.startActivity(ContextImpl.java:836)
at android.app.ContextImpl.startActivity(ContextImpl.java:813)
at android.content.ContextWrapper.startActivity(ContextWrapper.java:357)
at com.dropbox.android.util.ip.a(panda.py:46)
at dbxyzptlk.db3420200.bk.w.run(panda.py:219)
at com.dropbox.android.activity.lock.LockReceiver.a(panda.py:295)
at dbxyzptlk.db3420200.bk.v.a(panda.py:213)
at dbxyzptlk.db3420200.bk.v.a(panda.py:270)
at dbxyzptlk.db3420200.bk.aa.a(panda.py:182)
at dbxyzptlk.db3420200.bk.aa.a(panda.py:33)
at dbxyzptlk.db3420200.et.a.onPostExecute(panda.py:153)
at android.os.AsyncTask.finish(AsyncTask.java:660)
at android.os.AsyncTask.-wrap1(AsyncTask.java)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:677)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6209)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

8 Replies

  • ori's avatar
    ori
    Explorer | Level 3
    8 years ago

    I found out that it happens with every app!

    And every file.

     

    If I try to open a file.txt from Dropbox - 

    Dropbox offers me a list of apps that can open .txt file.

    7 out of 9 caus Dropbox to through FileUriExposedException

     

     

  • Mark's avatar
    Mark
    Icon for Super User II rankSuper User II
    8 years ago
    I'm moving this to API forum as you'll need to fix the issue in your app for it to work.
  • burnitall's avatar
    burnitall
    Explorer | Level 3
    8 years ago

    Hi, this is not an issue with our apps. Dropbox crashes before Android even asks for which app to send it to. You can see that from ori's stack trace. It does not contain any symbol other than Android and Dropbox.

     

    The issue is that Dropbox tries to export a Uri with a "file" scheme. If you look at the documentation for FileUriExposedException, it explains that for apps targeting N, that exception is thrown, and the app needs to be changed to export a "content" scheme. The app exporting the Uri is Dropbox. Dropbox needs to be fixed.

  • ori's avatar
    ori
    Explorer | Level 3
    8 years ago

     

    Hi
    I appology in advance, this is my first Android app.
    So it may be the case that I am 180 degrees of track.

     

    I found a DropBox suggested implementation for a file chooser
    But I ended up working around this issue:

     

    On my phone - in DropBox - I set my folder to be 'available offline'
    This reults a loacl copy of my folder on my phone at:
    /sdcard/Android/data/com.dropbox.android/files/u7778889/scratch/my-folder

     

    I then use ES File Exploer to accsess my local files
    with an intent-filter for files not content.

     

     

    DropBox has a file chooser that I can integreate into my app:
    https://www.dropbox.com/developers/documentation/java
    The example works but I never integrated it with my app.

     

     

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    8 years ago
    Thanks for the reports! I'll send this over to the right people here to look into it.

About Dropbox API Support and Feedback

Node avatar for Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!