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

IOS app crashing when using FileStream on Iphone 4s

Participant ,
May 06, 2015 May 06, 2015

Copy link to clipboard

Copied

Hi

My ios app downloading zip file which contains several mp3 files, extracting these files from zip file and writing to applicationStorageDirectory via fileStream.writeBytes method asynchronously.

app works fine on Iphone 4 (ios version 7.0.3, adobe air sdk 17.0.0.144 and 18.0.0.109 )

but same app crashed on Iphone 4s (ios version 7.0.6, adobe air sdk 17.0.0.144 and 18.0.0.109 ) when writing the mp3 files to the applicationStorageDirectory.

i reproduced the FileStream issue successfully and uploaded a sample app to google drive. You can download from here: FileStreamTest.rar - Google Drive

please inform me about the issue because i must wait you to send my app to the appstore.

thanks.

TOPICS
Development

Views

1.6K

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
Advocate ,
May 06, 2015 May 06, 2015

Copy link to clipboard

Copied

how much free space on your 4s?

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
Participant ,
May 06, 2015 May 06, 2015

Copy link to clipboard

Copied

zip file size: 100 mb

free space of iphone 4s: 3.2 gb

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
Advocate ,
May 07, 2015 May 07, 2015

Copy link to clipboard

Copied

Compile your IPA in debug mode, connect to runtime on device and run. May be you will see some errors

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
Participant ,
May 07, 2015 May 07, 2015

Copy link to clipboard

Copied

Anton, thanks for reply.

I tested in debug mode but i had not got any error.

Also i tested by using try catch block but result did not change too because app crashed without any error message.

So i don't know the reason of the crash and i have not another iphone 4s device to make more tests.

if you have any iphone 4s device please download the attached sample app and test it.

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
Advocate ,
May 07, 2015 May 07, 2015

Copy link to clipboard

Copied

Go to FileManager.as and fix this string:

fileStream.addEventListener(Event.CLOSE, fileCompleteHandler);

you attaching listener each time you write file but don't remove this listener each time

or edit this method similar

if (fileSteam == null ) {

fileSteam = new FileStream();

fileStream.addEventListener(Event.CLOSE, fileCompleteHandler)

}

and after all files complete - remove that listener      

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
Participant ,
May 08, 2015 May 08, 2015

Copy link to clipboard

Copied

Anton thanks again,

i changed the code as you mentioned above and such as below but in both cases app crashed again.

public static function writeBytesToFileAsync(file:File, bytes:ByteArray)  {

  if (! fileStream)

     fileStream = new FileStream();


  fileStream.addEventListener(Event.CLOSE, fileCompleteHandler);

  fileStream.openAsync(file, FileMode.WRITE);

  fileStream.writeBytes(bytes, 0, bytes.length);

  fileStream.close();

  }

private static function fileCompleteHandler(event:Event):void {


  if (fileStream) {

     fileStream.removeEventListener(Event.CLOSE, fileCompleteHandler);

     fileStream = null;

     trace("fileStream disposed!");

   }

}

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
Participant ,
May 11, 2015 May 11, 2015

Copy link to clipboard

Copied

I tested on iphone 4 too but device sometimes crashed. Adobe, if you have any idea or suggestion about the problem please help me! thanks.

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
Participant ,
May 13, 2015 May 13, 2015

Copy link to clipboard

Copied

i also tested same app on Galaxy Note 4 and app works fine.

i have been added a bug report on bugbase:

Bug#3986857 - ADOBE AIR IOS app crashing when using FileStream

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
Adobe Employee ,
May 13, 2015 May 13, 2015

Copy link to clipboard

Copied

Hi,

Thanks for reporting the issue,

we package the ipa using provided swf and xml file but on launching application on different device including iPhone 4s. we can see only a button named "Click". but nothing happens on clicking it, application doesn't crash.

Could you please elaborate the reproducible steps.

Also, we tried with sample project shared but on compiling it, we get a error "type was not found or was not a compile-time constant: signal".

Regards,

Jitender

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
Participant ,
May 13, 2015 May 13, 2015

Copy link to clipboard

Copied

Jitender, thanks for reply.

1) Extract the FileStreamTest.zip file and open the FileStreamTest.fla file.

2) Add fzip and signal libraries which are in the same directory through source path from the ActionScript Settings.

3) Compile the app with Adobe AIR for IOS and install the app to Iphone 4 or Iphone 4s

4) Click the button named "Click" to download zip file from internet via provided url.

5) if all operations (extracting files from the zip and writing them to applicationStorageDirectory) be successful without crash button name will change to "finished!".

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
Adobe Employee ,
May 18, 2015 May 18, 2015

Copy link to clipboard

Copied

Thanks for detailed step,

We tried the issue but couldn't reproduce it on any device. we could successfully see the "finished" text.

However, we tested issue with our own zip file as zip provided by you was not downloading ( kept the device for more than 1 hour but nothing happened).

Could you please verify it on some other devices (if you have), also is this issue reproducible with that particular zip file or happening with other zip files ?

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
Participant ,
May 18, 2015 May 18, 2015

Copy link to clipboard

Copied

However, we tested issue with our own zip file as zip provided by you was not downloading ( kept the device for more than 1 hour but nothing happened).

from the Fzip offical documents: FZip is able to process, create and modify standard ZIP archives as described in the PKZIP file format documentation.

Could you please verify it on some other devices (if you have), also is this issue reproducible with that particular zip file or happening with other zip files ?

Yes, i have been tested with different zip files which contains 200 and 320 png files.

I have been observed crash on iphone 4 and iphone 4s by downloading and writing contents of bigger zip file (155 mb) but there is no any crash with smaller zip file (97 mb) on Iphone 4. (and crash continues on Iphone 4s)

I'm not sure but probably cause of the issue is memory allocation of the devices when downloading bigger zip file and writing contents of this zip file to applicationStorageDirectory via FileStream.

And i have been uploaded a new test app which is more simple than previous one to google drive without signals and unnecessary codes, please download. FileStreamTest2.rar - Google Drive

thanks for advance.

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
Advocate ,
May 18, 2015 May 18, 2015

Copy link to clipboard

Copied

LATEST

iOS 7.1.2 iPhone 4. Compiled from your FileStreamTest2.rar - Google Drive

Try to unload all apps from background. Maybe your device loaded by background apps. Also you never published crash report here.

Don't see any crash.

AIR used 18.0.0.114 - 18.0.0.122

IMG_1416.PNG

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