Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-23698

iOS: "CFURLSetResourcePropertyForKey failed" log appears when you use Ti.Filesystem.File.setRemoteBackup

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: Release 5.4.0
    • Fix Version/s: Release 5.4.0
    • Component/s: iOS
    • Labels:
    • Environment:

      Appc CLI NPM: 4.2.7
      Appc CLI Core: 5.4.0-35
      Arrow: 1.8.2
      SDK: 5.4.0.v20160727143921
      Node: v4.4.7
      OS: Mac OS X (10.11.6)
      Xcode: 7.3.1
      Device: iphone 5 (9.1)

    • Story Points:
      3
    • Sprint:
      2016 Sprint 16 SDK

      Description

      Details: CFURLSetResourcePropertyForKey failed log appears when you use Ti.Filesystem.File.setRemoteBackup.

      Here is a related stackover link, which seems to be done in this PR for TIMOB-23141.

      Steps to reproduce:

      1. Create a classic mobile project: appc new --classic
      2. In the app.js file, replace the code with this code:

        var useBackup = false;
         
        var win = Ti.UI.createWindow({
            backgroundColor: "#fff"
        });
         
        var btn = Ti.UI.createButton({
            title: "Toggle remote backhup"
        });
         
        var dir = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, "test");
         
        if (!dir.exists()) {
            Ti.API.info("### Recursive directory does not exist, yet");
         
            var newDir = dir.createDirectory();
            if (!newDir) {
                Ti.API.error("### Root directory could not be created");
            }
            else {
                for (var i = 0; i < 20; i++) {
                    var tmp = Ti.Filesystem.getFile(dir.nativePath, "subDirectory-" + i);
                    if (!tmp.createDirectory()) {
                        Ti.API.error("### Subdirectory " + i + " could not be created!");
                    }
                    else {
                        Ti.API.warn("### Subdirectory " + i + " is created!");
                    }
                }
         
                var newFile = Ti.Filesystem.getFile(dir.nativePath, "file.txt");
                if (!newFile.write('i am a monkeylord')) {
                    Ti.API.error("### File could not be created!");
                }
                else {
                    Ti.API.warn("### File is created!");
                }
            }
        }
        else {
            Ti.API.info("### Recursive directory already exists");
        }
         
        // Ti.API.warn('### setting remoteBackup property to true');
        // dir.remoteBackup = true;
         
        btn.addEventListener("click", function() {
            useBackup = !useBackup;
            Ti.API.info('### useBackup ' + useBackup);
            dir.setRemoteBackup(useBackup);
        });
         
        win.add(btn);
        win.open();
        

      3. Install app to an iOS device
      4. Press the Toggle remote backhup button

      Actual: The following log will appear:

      [INFO] CFURLSetResourcePropertyForKey failed because it was passed an URL which has no scheme
      

      Expected: No erroneous log should appear.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                cng Chee Kiat Ng (Inactive)
                Reporter:
                wluu Wilson Luu (Inactive)
                Reviewer:
                Hans Knöchel
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-9958
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Integration