0
votes

Following is output on my console:

[SWF] autoupdate.swf - 3,204,024 bytes after decompression private function onError(event:ErrorEvent):void [ErrorEvent type="error" bubbles=false cancelable=false eventPhase=2 text="Unhandled exception TypeError: Error #1009: Cannot access a property or method of a null object reference." errorID=1009]

my code is in Application Create Event (s:ViewNavigatorApplication)

protected function viewnavigatorapplication1_creationCompleteHandler(event:FlexEvent):void
{
    setApplicationVersion(); 
    appUpdater.delay = 1;
    appUpdater.isDownloadProgressVisible = true;
    appUpdater.isDownloadUpdateVisible = true

    appUpdater.isInstallUpdateVisible = true;
    appUpdater.isFileUpdateVisible = true;

    appUpdater.updateURL = "http://localhost/updater/update.xml";           
    appUpdater.isCheckForUpdateVisible = false; // sajjad false initially 
    appUpdater.addEventListener(UpdateEvent.INITIALIZED, onUpdate);
    appUpdater.addEventListener(ErrorEvent.ERROR, onError);
    appUpdater.initialize();
}
private function onError(event:ErrorEvent):void
{
    //Alert.show(event.toString());
    trace("private function onError(event:ErrorEvent):void");
    trace(event);
}

private function onUpdate(event:UpdateEvent):void
{
    trace("private function onUpdate(event:UpdateEvent):void");
    appUpdater.checkNow(); // Go check for an update now         } 
}

I have added the http://www.adobe.com/devnet/air/articles/air_update_framework.html

Can it be the case that i am trying to export the flex mobile application as desktop application and i need to create a desktop only project ?

1

1 Answers

0
votes

Its is better advice that you need to create a separate project for Mobile Application (ViewNavigatorApplication) and Desktop AIR(WindowedApplication) both are different. Air Application Updater Framework supports only for AIR(Desktop) applications, If you need Application updater for Native Application such as .exe or .dmg(MAC) you can use an external Native application updater library.

AIR Application updater:

http://help.adobe.com/en_US/AIR/1.5/devappsflex/WS5b3ccc516d4fbf351e63e3d118666ade46-7ff2.html#WS9CD40F06-4DD7-4230-B56A-88AA27541A1E

Native Application Updater:

http://www.riaspace.com/2010/08/nativeapplicationupdater-updater-for-air-apps-packaged-with-native-installers/ http://code.google.com/p/nativeapplicationupdater/

These updater frameworks don't support Mobile Applications. Since mobile applications (apk-Android and ipa-iOS) are native installers for mobile they have different update mechanism for that you need to launch a new version in AppStore(iOS) or PlayStore(Android).

Refer this Docx for mobile Application update: http://help.adobe.com/en_US/air/build/WS901d38e593cd1bac-77bd3ea112e2c0a7ed0-8000.html