Start a new topic

Titanium captureScreen Method issue for iOS

Titanium captureScreen Method issue for iOS

I am using latest Wikitude SDK 3.3.1 but I found some issues of captureScreen Method.


1) If I use custom path, the image can be saved (APP Documents folder).  However,when I try to read the image, the APP crashed.


Below is my environment.

Titanium Studio, build:

Titanium SDK 3.2.3GA

iOS version : 7.1.1


2) When new photo is taken, it can not replace old photo. There is an Alert saying "The operation couldn't be completed. (Cocoa error 516)"


The function works in Xcode though, but not in Titanium module.


Thank you,

Hi Johnny!
1) Which Module are you using to open the image from the app bundle? Is it a Titanium Module or a 3rd party Module? Can you open the image with a tool like iExplorer?

2) You have to give each image a new name. The Module is set up to not override existing images. If you specifically need to disable this functionality, please send a mail to


Best regards


Dear Andreas,

Regarding issue 1, I am using native Titanium function to read out the image. And Yes. iExporer can open the image.

Below is the code: Thank you


var arv = wikitude.createWikitudeView({ "licenseKey": ".......","augmentedRealityMode": "IRAndGeo", bottom: 0,left: 0, right: 0, top: 0 });

     arv.captureScreen(includeWebView, "image.png" , { 

         onSuccess: function(path)


            var f = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory, "image.png");

            //get crashed


         onError: function(errorDescription)


           alert('error: ' + errorDescription);





Right now I can't test your code, but just a few thoughts:

1) Titanium.Filesystem.applicationDataDirectory:
Where does this directory is supposed to be in the app bundle? The Wikitude SDK will save the file into the App Sandbox 'Documents' directory. So make sure that Titanium is looking into the correct directory.

2) Add a try/catch block to capture any Titanium.Filesystem errors. They are likely throwing an exception why they cannot open the file.

I will try it out myself asap and provide you more information. 

Best regards


Hi Andreas

The issue is solved.

The workaround is to call Titanium.Filesystem.getFile outside onSuccess.

Login or Signup to post a comment