Skip to main content
Known Participant
January 24, 2017
Answered

AIR 24 File.requestPermission throws error #1069 on Android 6.0.1

  • January 24, 2017
  • 2 replies
  • 2520 views

We're attempting to use the new permissions functions in AIR 24 to access files on "external" storage on Android. However, when we call requestPermission() on a File object, it throws error #1069 (property not found). We're using AIR 24.0.0.181 (a custom build provided by Adobe for a specific fix that didn't make it in time for the AIR 24 release). Any clues on what's wrong here?

Example code:

function downloadInfo(obbDir:File, infoURL:String) : void {

     var infoFile:File = obbDir.resolvePath(fileName);

     if (File.permissionStatus == PermissionStatus.GRANTED) {

          beginInfoDownload(infoFile, infoURL);

     } else {

          // need to ask for filesystem permissions

          infoFile.addEventListener(PermissionEvent.PERMISSION_STATUS, function(e:PermissionEvent):void {

               if (e.status == PermissionStatus.GRANTED) {

                    beginInfoDownload(infoFile, infoURL);

               } else {

                    // permission denied

                    trace("Filesystem permission denied by user");

                    setTimeout(function():void {

                         dispatchEvent(new Event(PERMISSION_REFUSED));

                    }, 1);

               }

          });

          try {

               infoFile.requestPermission();

          } catch(e:Error) {

               trace("Error requesting file permissions: " + e.message);

               setTimeout(function():void {

                    dispatchEvent(new Event(PERMISSION_REFUSED)); // for now, treat like it was refused

               }, 1);

          }

     }

}

This topic has been closed for replies.
Correct answer Harry248

Are you sure you have added -swf-version=35 to the additional compiler options?

2 replies

deesharm
Adobe Employee
Adobe Employee
January 24, 2017

Hi Unsanctioned,

Please make sure that you have imported below two packages:

import flash.events.PermissionEvent;

import flash.permissions.PermissionStatus;

And swf version should be equal to or greater than 35.

Please let us know if you still face the problem.

Thanks,

Adobe AIR Team

Harry248Correct answer
Inspiring
January 24, 2017

Are you sure you have added -swf-version=35 to the additional compiler options?