Skip to main content
Inspiring
January 11, 2019
Answered

iOS app crashes if a NetStream is referenced by a class variable when app is brought to foreground

  • January 11, 2019
  • 4 replies
  • 2341 views

Consistently happens on AIR 32 (tried also 27 and 31), iOS 12 and 8.

A video of this happening on both iOS8 and iOS12: airiosbug.mp4 - Google Drive

Just create a NetConnection and a NetStream.

If class has a variable referncing the NetStream, if app is brought to background and then to foreground, it crashes immediately.

If NetStrean is not referenced, app doesn't crash.

Crash log infact reports a null pointer.

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)

Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000000

Note that app works perfectly and for a long time if not brought to background and back to foreground again. Crashes only when brought back to foreground.

You can download source code here: https://drive.google.com/open?id=1s92-Wv99dechTZgqRxNMpf-C1SabxBNh

Here is the only code:

Commenting: "_ns = ns;" application does not crash.

package

{

import flash.display.MovieClip;

import flash.net.NetConnection;

import flash.net.NetStream;

import flash.text.TextField;

/**

* ...

* @author Pippo Gregoretti

*/

public class MainAppDebug extends MovieClip

{

private var _tf:TextField;

private var _ns:NetStream;  

public function MainAppDebug()

{

super();

trace("Debugging AIR application.");

//(_debugConsole as DebugConsole).show();

_tf = new TextField();

_tf.border = true;

_tf.width = stage.stageWidth;

_tf.height = stage.stageHeight;

_tf.multiline = true;

addChild(_tf);

addText("Debugging AIR Application");

addText("Creating NetStreams...");

var nc:NetConnection = new NetConnection();

nc.connect(null);

var ns:NetStream = new NetStream(nc);

/* THIS IS THE CULPRIT. COMMENT "_ns = ns" AND APP WILL NOT CRASH */

_ns = ns;

}

private function addText(t:String):void {

_tf.appendText(t + "\n");

}

}

}

This topic has been closed for replies.
Correct answer Rohit Guglani

Hello All,

We have done a AIR beta today, you can download it from Adobe AIR 32 Beta | application development - Adobe Labswhich contains the fix for this issue.

Regards,

Rohit

4 replies

Rohit Guglani
Adobe Employee
Rohit GuglaniCorrect answer
Adobe Employee
February 13, 2019

Hello All,

We have done a AIR beta today, you can download it from Adobe AIR 32 Beta | application development - Adobe Labswhich contains the fix for this issue.

Regards,

Rohit

PippoAppsAuthor
Inspiring
February 14, 2019

Thank you very much. I have tested and confirm this is fixed! You Rock!

PippoAppsAuthor
Inspiring
February 1, 2019

Dear Zwetan,

Since "developer time is precious", I am really moved by the effort you are putting in this. Thank you very much for your valuable contribution.

Just to let you know, I have been contacted by AIR staff, and they are working on a fix for this bug.

Probably your valuable effort in testing out on iOS and other platforms, and writing a better code gave then the hint they needed.

Regards

Pippo

Amrita Gangwani
Adobe Employee
Adobe Employee
January 15, 2019

Hi,

Thank you for reporting the issueL The .libs and .src folders referenced by your application are missing in the above shared link. Please file a bug on Tracker​ and attach the complete source code for us to better understand the issue.

Thanks!

PippoAppsAuthor
Inspiring
January 15, 2019

Hello Amrita,

Don't worry about libs and src, they are empty.

Just remove the references. Thank you.

Please check this issue since it makes Netstream unusable on Ios.

Regards

PippoAppsAuthor
Inspiring
January 11, 2019

Here is the app descriptor:

<application xmlns="http://ns.adobe.com/air/application/32.0">

  <id>obscured</id>

  <versionNumber>0.4</versionNumber>

  <filename>AppName</filename>

  <description/>

  <name>AppName</name>

  <copyright/>

 

  <initialWindow>

   <content>AppName.swf</content>

   <systemChrome>standard</systemChrome>

   <transparent>false</transparent>

   <visible>true</visible>

   <fullScreen>true</fullScreen>

  

   <renderMode>direct</renderMode>

   <maximizable>true</maximizable>

   <minimizable>true</minimizable>

   <resizable>true</resizable>

   <autoOrients>true</autoOrients>

   <depthAndStencil>true</depthAndStencil>

   <aspectRatio>landscape</aspectRatio></initialWindow>

  <icon/>

  <customUpdateUI>false</customUpdateUI>

  <allowBrowserInvocation>false</allowBrowserInvocation>

  <supportedProfiles>desktop extendedDesktop mobileDevice extendedMobileDevice </supportedProfiles>

  <iPhone>

   <InfoAdditions><![CDATA[

  <key>UIDeviceFamily</key>

  <array>

  <string>1</string>

  <string>2</string>

  </array>

]]></InfoAdditions>

   <requestedDisplayResolution>high</requestedDisplayResolution>

  </iPhone>

  <supportedLanguages>en</supportedLanguages>

</application>