Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Android™ Development

Reply
New Contributor
Posts: 8
Registered: ‎03-25-2013
My Device: BB10
My Carrier: Vodafone

Permission denied when trying to create a file in the cash folder

My app download files to the cache folder and open them in their viewers. Few users reported the following error:

/sdcard/Android/data/<package name>/cache/1/filename.docx (Permission denied)

 

I use Context.getExternalCacheDir() to get the cache folder.

 

I tried the same scenario and produced no errors on dev alpha (10.0.10.648) and on two simulator 10.0.10.672 and 10.0.9.1673

 

All users reports are coming from 10.0.0.x but the corresponding simulators for these older version are no longer available for download.

 

Any suggestions? Is it a known issue with 10.0.0.x ?

 

Thanks for your help

Contributor
Posts: 19
Registered: ‎04-03-2013
My Device: Z10
My Carrier: Reliance India

Re: Permission denied when trying to create a file in the cash folder

Hi There,

Our App SignEasy is also facing the same issue when trying to save the files downloaded from our server. We are writing the file to the application directory at /data/data/[package name]/files.

It happens randomly for some users and we have not been able to identify the root cause.

Did you find a solution?

Thanks
Sunil
New Contributor
Posts: 8
Registered: ‎03-25-2013
My Device: BB10
My Carrier: Vodafone

Re: Permission denied when trying to create a file in the cash folder

No I didn't, but I noticed these error reports are less frequent now.

Retired
Posts: 264
Registered: ‎01-08-2013
My Device: BlackBerry 10 Dev Alpha B
My Carrier: Bell

Re: Permission denied when trying to create a file in the cash folder

I can't seem to reproduce this on my 10.0.10.648 Dev Alpha B or the recent simulators.

 

Any idea of how old the builds are that this is failing on?

 

    Justin

Justin Jasmann | Android Application Development Consultant
Developer Relations
developer.blackberry.com
Contributor
Posts: 19
Registered: ‎04-03-2013
My Device: Z10
My Carrier: Reliance India

Re: Permission denied when trying to create a file in the cash folder

My Z10 is running OS version 10.0.10.261.

Retired
Posts: 264
Registered: ‎01-08-2013
My Device: BlackBerry 10 Dev Alpha B
My Carrier: Bell

Re: Permission denied when trying to create a file in the cash folder

Would you be able to retrieve the device logs and attach them here?

 

    Justin

Justin Jasmann | Android Application Development Consultant
Developer Relations
developer.blackberry.com
Contributor
Posts: 19
Registered: ‎04-03-2013
My Device: Z10
My Carrier: Reliance India

Re: Permission denied when trying to create a file in the cash folder

Hi Justin,

 

Thanks for looking into the issue and I will try to provide as much as information you need. I did not

find any options to attach the logs, hence I have pasted it below. Please note that these logs were captured in Eclipse IDE over logcat even if the official appworld build was running on the device. After that, I have not been able to find an easy way to capture the device logs directly from the BlackBerry 10 device. Is some sort of alogcat (like in Android) available for BlackBerry's Android Run Time?

 

03-09 19:34:57.766: I/ActivityManager(10961092): Starting: Intent { act=easysign.sign.document cmp=com.glykka.easysign/.SignDocument (has extras) } from pid 14569697
03-09 19:34:57.771: V/WindowManager(10961092): Set focused app to: AppWindowToken{7a27a718 token=HistoryRecord{7a27a478 com.glykka.easysign/.SignDocument}}
03-09 19:34:57.776: I/Instrumentation(14569697): invoking onCreate() for Activity com.glykka.easysign.SignDocument
03-09 19:34:57.862: I/EasySignLog(14569697): Download File Flow - Step 1
03-09 19:34:57.866: D/EasySignLog(14569697): client downloading original file from server, file name :Mutual_NDA.pdf
03-09 19:34:57.932: I/QNXNavigatorClient(10961092): PackagesOpenedRunnable: [com.glykka.easysign]
03-09 19:34:58.107: I/ActivityManager(10961092): Displayed com.glykka.easysign/.SignDocument: +336ms
03-09 19:35:01.513: I/EasySignLog(14569697): Download File Flow - Step 2
03-09 19:35:01.513: I/EasySignLog(14569697): Download File Flow - Step 3
03-09 19:35:01.513: I/EasySignLog(14569697): Download File Flow - Step 4
03-09 19:35:01.523: W/System.err(14569697): java.io.FileNotFoundException: /data/data/com.glykka.easysign/files/[email_address_of_SignEasy_user]/Original_documents/Mutual_NDA.pdf (Permission denied)
03-09 19:35:01.537: W/System.err(14569697):     at org.apache.harmony.luni.platform.OSFileSystem.open(Native Method)
03-09 19:35:01.537: W/System.err(14569697):     at dalvik.system.BlockGuard$WrappedFileSystem.open(BlockGuard.java:232)
03-09 19:35:01.538: W/System.err(14569697):     at java.io.FileOutputStream.<init>(FileOutputStream.java:94)
03-09 19:35:01.538: W/System.err(14569697):     at java.io.FileOutputStream.<init>(FileOutputStream.java:165)
03-09 19:35:01.538: W/System.err(14569697):     at java.io.FileOutputStream.<init>(FileOutputStream.java:144)
03-09 19:35:01.538: W/System.err(14569697):     at com.glykka.easysign.util.EasySignUtil.saveFile(EasySignUtil.java:378)
03-09 19:35:01.539: W/System.err(14569697):     at com.glykka.easysign.SignDocument$SyncDocument.handleFileDownload(SignDocument.java:1652)
03-09 19:35:01.539: W/System.err(14569697):     at com.glykka.easysign.SignDocument$SyncDocument.doInBackground(SignDocument.java:1480)
03-09 19:35:01.539: W/System.err(14569697):     at com.glykka.easysign.SignDocument$SyncDocument.doInBackground(SignDocument.java:1)
03-09 19:35:01.539: W/System.err(14569697):     at android.os.AsyncTask$2.call(AsyncTask.java:185)
03-09 19:35:01.539: W/System.err(14569697):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
03-09 19:35:01.540: W/System.err(14569697):     at java.util.concurrent.FutureTask.run(FutureTask.java:138)
03-09 19:35:01.540: W/System.err(14569697):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
03-09 19:35:01.540: W/System.err(14569697):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
03-09 19:35:01.540: W/System.err(14569697):     at java.lang.Thread.run(Thread.java:1019)
03-09 19:35:03.041: I/EasySignLog(14569697): Download File Flow - Step 5
03-09 19:35:03.042: I/EasySignLog(14569697): android client finished download, file name :Mutual_NDA.pdf
03-09 19:35:03.045: I/EasySignLog(14569697): Read File Flow - Step 1
03-09 19:35:03.047: I/download file Smiley Sad14569697): Mutual_NDA.pdf
03-09 19:35:03.047: I/EasySignLog(14569697): Read File Flow - Step 2
03-09 19:35:03.048: I/EasySignLog(14569697): Read File Flow - Step 9
03-09 19:35:03.050: I/EasySignLog(14569697): Read File Flow - Step 10
03-09 19:35:31.217: I/QNXNavigatorClient(10961092): setScreenOff
03-09 19:35:31.756: I/QNXNavigatorClient(10961092): onActive: cid=42964242463 false
03-09 19:35:31.758: I/QNXNavigatorClient(10961092): onWindowState: cid=42964242463 state=invisible
03-09 19:35:31.759: I/QNXNavigatorClient(10961092): setWindowState
03-09 19:35:32.258: I/QNXNavigatorClient(10961092): leaveGroup com.glykka.easysign: 0

 

----

 

The issue randomly happens only for files being storied in a subdirectory named "Original_documents" in the released build, but not in the other subdirectories in our application sandbox storage.

 

Thanks

Sunil

Retired
Posts: 264
Registered: ‎01-08-2013
My Device: BlackBerry 10 Dev Alpha B
My Carrier: Bell

Re: Permission denied when trying to create a file in the cash folder

[ Edited ]

That's great, thanks a lot Sunil.

 

I think it may be faster if you can log an issue and then send me the link. I'll escalate it A.S.A.P after this.

Link: https://www.blackberry.com/jira

 

    Justin

Justin Jasmann | Android Application Development Consultant
Developer Relations
developer.blackberry.com
Contributor
Posts: 19
Registered: ‎04-03-2013
My Device: Z10
My Carrier: Reliance India

Re: Permission denied when trying to create a file in the cash folder

The PR link connection is timing out on my side, hence I am unable to open a bug for now.

 

If you can access the PR site successfully, would you please open the bug so that the investigation starts asap?

 

Thanks,

-Sunil

 

 

Retired
Posts: 264
Registered: ‎01-08-2013
My Device: BlackBerry 10 Dev Alpha B
My Carrier: Bell

Re: Permission denied when trying to create a file in the cash folder

Sorry about that, I used the wrong link. The post has now been updated.

Let me know if you can log one through that URL. I can also do it for you, but this way you'll get instantaneous response as to the progress of it with the development team.

 

Link copy: https://www.blackberry.com/jira

 

    Justin

Justin Jasmann | Android Application Development Consultant
Developer Relations
developer.blackberry.com