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

Cannot open file while is at app data location '/data/data/<app_id>/cache' #324

Closed
ncomo11 opened this issue Aug 10, 2021 · 4 comments
Closed

Comments

@ncomo11
Copy link

ncomo11 commented Aug 10, 2021

Expected Behaviour

File should get open in assosiated application

Actual Behaviour

Gives error "File not Found"

Reproduce Scenario (including but not limited to)

Have below plugins:
cordova-plugin-file-opener2 3.0.5 "File Opener2"
cordova-plugin-camera 4.1.0 "Camera" -> Not sure if this plugin conflicts or not but better to have it

Steps to Reproduce

  1. Programmatically or manually create a file at context.getApplicationInfo().dataDir (i.e. '/data/data/<app_id>/cache')
    Note: 'context' is cordova context
  2. try to opne above file using plugin call:
    var filePath = ;
    var fileMIMEType = 'text/plain'; // file mine type
    cordova.plugins.fileOpener2.open(
    filePath,
    fileMIMEType,
    {
    error : function(err){ console.log('error:',err)},
    success : function(){ console.log('success')}
    }
    );

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

Android OS 11

(Android) What device vendor (e.g. Samsung, HTC, Sony...)

Pixel 3 XL

Cordova CLI info

cordova info

Here is the output:
cordova-lib@9.0.1 with:
cordova-common@3.2.1
cordova-create@2.0.0
cordova-fetch@2.0.1
cordova-serve@3.0.0

Environment:
OS: win32
Node: v12.18.2
npm: 6.14.8

Plugin version

cordova plugin version | grep cordova-plugin-file-opener2

Here is the output:
cordova-plugin-camera 4.1.0 "Camera"
cordova-plugin-file-opener2 3.0.5 "File Opener2"

Sample Code that illustrates the problem

var filePath = ;
var fileMIMEType = 'text/plain'; // file mine type
cordova.plugins.fileOpener2.open(
filePath,
fileMIMEType,
{
error : function(err){ console.log('error:',err)},
success : function(){ console.log('success')}
}
);

Logs taken while reproducing problem

Run

adb logcat PluginManager:V CordovaPlugin:V CordovaLog:V chromium:V *:S

while testing the bug in your app to get some output from your error. This will help you to understand more about the nature of your problem.

@rohit0009
Copy link

I am facing this same issue with the latest plugin version

cordova-android version 8.0.0

@shnist
Copy link
Collaborator

shnist commented Feb 6, 2023

I believe this is a duplicate of #310

@shnist shnist closed this as completed Feb 6, 2023
@fayezshahidtlx
Copy link

I believe this is a duplicate of #310

bro why are you closing these issues, even if it is a duplicate i cannot find any solution in 310, 311, 324 or any of those issues because you are closing each one of them. I am stuck in this problem for 2 weeks what should i do ???

@fayezshahidtlx
Copy link

Expected Behaviour

File should get open in assosiated application

Actual Behaviour

Gives error "File not Found"

Reproduce Scenario (including but not limited to)

Have below plugins: cordova-plugin-file-opener2 3.0.5 "File Opener2" cordova-plugin-camera 4.1.0 "Camera" -> Not sure if this plugin conflicts or not but better to have it

Steps to Reproduce

  1. Programmatically or manually create a file at context.getApplicationInfo().dataDir (i.e. '/data/data/<app_id>/cache')
    Note: 'context' is cordova context
  2. try to opne above file using plugin call:
    var filePath = ;
    var fileMIMEType = 'text/plain'; // file mine type
    cordova.plugins.fileOpener2.open(
    filePath,
    fileMIMEType,
    {
    error : function(err){ console.log('error:',err)},
    success : function(){ console.log('success')}
    }
    );

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

Android OS 11

(Android) What device vendor (e.g. Samsung, HTC, Sony...)

Pixel 3 XL

Cordova CLI info

cordova info

Here is the output: cordova-lib@9.0.1 with: cordova-common@3.2.1 cordova-create@2.0.0 cordova-fetch@2.0.1 cordova-serve@3.0.0

Environment: OS: win32 Node: v12.18.2 npm: 6.14.8

Plugin version

cordova plugin version | grep cordova-plugin-file-opener2

Here is the output: cordova-plugin-camera 4.1.0 "Camera" cordova-plugin-file-opener2 3.0.5 "File Opener2"

Sample Code that illustrates the problem

var filePath = ; var fileMIMEType = 'text/plain'; // file mine type cordova.plugins.fileOpener2.open( filePath, fileMIMEType, { error : function(err){ console.log('error:',err)}, success : function(){ console.log('success')} } );

Logs taken while reproducing problem

Run

adb logcat PluginManager:V CordovaPlugin:V CordovaLog:V chromium:V *:S

while testing the bug in your app to get some output from your error. This will help you to understand more about the nature of your problem.

any progress? i am also facing this issue for a couple of days

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

4 participants