• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

cameraRoll.addBitmapData() causing #2038 file I/O error in AIR SDK 30

New Here ,
May 31, 2018 May 31, 2018

Copy link to clipboard

Copied

When I call cameraRoll.addBitmapData() on Android, I get a #2038 file I/O error which probably is due to a security issue. This happens with AIR SDK 30 Beta. I didn't have this issue with AIR SDK 24. I check for CameraRoll permissions, but still get this error when permission is granted. I’ve verified that the Android manifest has <uses-permission android:name=“android.permission.WRITE_EXTERNAL_STORAGE”/>. I’ve reduced the dimensions of the image to be half its size (now 720x936). I'm still getting this error and don't know what else to check.

Is it possible that this issue is with the AIR SDK 30 itself? Have others seen this issue with the AIR SDK 30? Is there something else I need to try that doesn't involve using older SDKs?

Thanks.

Rick Hocker

TOPICS
Air beta

Views

851

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 31, 2018 May 31, 2018

Copy link to clipboard

Copied

The whole way that permissions are done was changed with Android 6, to make it more like iOS, and in AIR 24 the way it works was changed to be the same approach for both platforms.

See this article, and check if the way you're doing it is how AIR 24 and later needs it to be:

12/13/2016 - Release - AIR 24 Runtime and SDK

The XML changes you made would be used for Android 4 and 5, but if you're setting a minimum of Android 6, then you have to work in the newer permissions way.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 01, 2018 Jun 01, 2018

Copy link to clipboard

Copied

I implemented permissions and it works now for iOS, but Android is still giving me the #2038 error whether I set the targetSDK to 16 or 24. We were using AIR 24 prior and it worked fine without permissions because we were targeting Android SDK 16. We jumped from AIR 24 to 30 so I don't know if saving to the CameraRoll might have worked in versions 25-29. The upgrade from 24 to 30 introduced the #2038 error. I'm combing forums to learn more about the #2038 error.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 01, 2018 Jun 01, 2018

Copy link to clipboard

Copied

LATEST

If you check the error details, does it give any more information? Here are some lines from my app that saves pictures (cr is just CameraRoll, bdToSave is the bitmapdata set up somewhere else), where I listen for the camera error event:

private function saveCamera(){

  try {

        cr.addEventListener(Event.COMPLETE, onSave);

        cr.addEventListener(ErrorEvent.ERROR,camerror);

        cr.addBitmapData(bdToSave);

  } catch (err){

       trace("camera fail:",err);

       noSave();

  }

}

private function camerror(e:ErrorEvent){

  trace("camera error:",e);

  noSave();

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines