Copy link to clipboard
Copied
Hi Folks, my first pass at creating an air updater and I am dead in the water.
I'm compling in Flex 4.0 with 3.0 compatibility mode. I place a breakpoint in statusBarBackground.setActualSize(unscaledWidth, unscaledHeight); and it's non-null the first time. Then I add call 'checkForUpdates()' and I get dump. I've tried setting the WindowedApplication to false etc etc. But no love.
What could be setting my statusBarBackground to null?
Here's the stack dump.
Main Thread (Suspended: TypeError: Error #1009: Cannot access a property or method of a null object reference.)
mx.core.windowClasses::StatusBar/updateDisplayList
mx.core::UIComponent/validateDisplayList
mx.managers::LayoutManager/validateDisplayList
mx.managers::LayoutManager/doPhasedInstantiation
mx.managers::LayoutManager/doPhasedInstantiationCallback
Hey Doug,
I tried out your sample (thanks by the way, makes my life *much* easier!) and I reproduced the exception with Flex 4.0/AIR 1.5.3 with Flex 3 compatibility turned on. I switched my SDK to Flex 4.1/AIR 2 with Flex 3 compatibility and the error went away.
Hope this helps,
Chris
Copy link to clipboard
Copied
Hi Doug,
Thanks for reporting the issue. I'll ask around, but is it possible to get access to a sample app that illustrates the problem?
Thanks,
Chris
Copy link to clipboard
Copied
Unfortunately no, it's behemoth to begin with and contains a bunch of prorietary data. If I don't get some insite from the forum, I'm going to need to start stripping it down and see if I can get a test case. If you come across anything that rings a bell or something I should try, please post.
Copy link to clipboard
Copied
Hi Chris,
It seems to be 4.0 with 3.0 compatibility mode flicked on which breaks the updater. I have a 1 file application below. Can you check it out without me sending you a project?
Thanks,
Doug
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication creationComplete="windowedapplication1_creationCompleteHandler(event)"
layout="absolute"
xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
import mx.events.FlexEvent;
protected function windowedapplication1_creationCompleteHandler(event:FlexEvent):void {
// TODO Auto-generated method stub
checkForUpdate();
}
import flash.events.ErrorEvent;
import air.update.ApplicationUpdaterUI;
import air.update.events.UpdateEvent;
import mx.controls.Alert;
private var appUpdater:ApplicationUpdaterUI = new ApplicationUpdaterUI();
private function checkForUpdate():void {
setApplicationVersion(); // Find the current version so we can show it below
appUpdater.updateURL = "http://wo.iointegration.com/workflow/workflow/air/update.xml"; // Server-side XML file describing update
appUpdater.isCheckForUpdateVisible = false; // We won't ask permission to check for an update
appUpdater.addEventListener(UpdateEvent.INITIALIZED, onUpdate); // Once initialized, run onUpdate
appUpdater.addEventListener(ErrorEvent.ERROR, onError); // If something goes wrong, run onError
appUpdater.initialize(); // Initialize the update framework
}
private function onError(event:ErrorEvent):void {
Alert.show(event.toString());
}
private function onUpdate(event:UpdateEvent):void {
appUpdater.checkNow(); // Go check for an update now
}
// Find the current version for our Label below
private function setApplicationVersion():void {
var appXML:XML = NativeApplication.nativeApplication.applicationDescriptor;
var ns:Namespace = appXML.namespace();
//ver.text = "Current version is " + appXML.ns::version;
}
]]>
</mx:Script>
</mx:WindowedApplication>
Copy link to clipboard
Copied
Hi Doug,
I'll try your code out but I had asked around about this post and heard back that this was a known issue but that it should be fixed with the latest AIR release. Here's a link to a forum post that discusses a problem similar to yours and the solution required:
http://forums.adobe.com/message/3060118#3060118
Chris
Copy link to clipboard
Copied
Hey Doug,
I tried out your sample (thanks by the way, makes my life *much* easier!) and I reproduced the exception with Flex 4.0/AIR 1.5.3 with Flex 3 compatibility turned on. I switched my SDK to Flex 4.1/AIR 2 with Flex 3 compatibility and the error went away.
Hope this helps,
Chris