[
https://issues.apache.org/jira/browse/CB-13432?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
jcesarmobile closed CB-13432.
-----------------------------
Resolution: Fixed
I can't reproduce with latest version.
Try with latest version and if you still face the problem, create a new issue
on github https://github.com/apache/cordova-plugin-media-capture/issues
> plugin crashes with sdk bigger than 23 - implement FileProvider
> ---------------------------------------------------------------
>
> Key: CB-13432
> URL: https://issues.apache.org/jira/browse/CB-13432
> Project: Apache Cordova
> Issue Type: Bug
> Components: cordova-plugin-media-capture
> Reporter: Joe Dalton
> Priority: Major
>
> With android sdk higher than 23 I get the following error:
> E/PluginManager: Uncaught exception from plugin
>
> android.os.FileUriExposedException:
> file:///storage/emulated/0/Android/data/at.my.namespace/cache/.Pic.jpg
> exposed beyond app through ClipData.Item.getUri()
>
> at android.os.StrictMode.onFileUriExposed(StrictMode.java:1799)
>
> at android.net.Uri.checkFileUriExposed(Uri.java:2346)
>
> at android.content.ClipData.prepareToLeaveProcess(ClipData.java:832)
>
> at android.content.Intent.prepareToLeaveProcess(Intent.java:9530)
>
> at android.content.Intent.prepareToLeaveProcess(Intent.java:9515)
>
> at android.app.Instrumentation.execStartActivity(Instrumentation.java:1525)
>
> at android.app.Activity.startActivityForResult(Activity.java:4403)
>
> at
> org.apache.cordova.CordovaActivity.startActivityForResult(CordovaActivity.java:342)
>
> at android.app.Activity.startActivityForResult(Activity.java:4362)
>
> at
> org.apache.cordova.CordovaInterfaceImpl.startActivityForResult(CordovaInterfaceImpl.java:66)
>
> at
> org.apache.cordova.camera.CameraLauncher.takePicture(CameraLauncher.java:294)
>
> at
> org.apache.cordova.camera.CameraLauncher.callTakePicture(CameraLauncher.java:265)
>
> at org.apache.cordova.camera.CameraLauncher.execute(CameraLauncher.java:174)
>
> at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:98)
>
> at org.apache.cordova.PluginManager.exec(PluginManager.java:132)
>
> at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:57)
>
> at
> org.apache.cordova.engine.SystemExposedJsApi.exec(SystemExposedJsApi.java:41)
>
> at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
>
> at
> org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:7)
>
> at android.os.Handler.dispatchMessage(Handler.java:102)
>
> at android.os.Looper.loop(Looper.java:154)
>
> at android.os.HandlerThread.run(HandlerThread.java:61)
> It looks like Uri.fromFile has to be replaced with FileProvider.getUriForFile
> https://stackoverflow.com/questions/38200282/android-os-fileuriexposedexception-file-storage-emulated-0-test-txt-exposed
> A quick fix is to limit the sdk to version 23 in config.xml:
> <platform name="android">
> <preference name="android-minSdkVersion" value="23" />
> <preference name="android-targetSdkVersion" value="23" />
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]