airsdk / Adobe-Runtime-Support

Report, track and discuss issues in Adobe AIR. Monitored by Adobe - and HARMAN - and maintained by the AIR community.
200 stars 11 forks source link

AIR SDK 50.0.1.1 Type Coercion Error #2210

Closed braintrain727 closed 1 year ago

braintrain727 commented 1 year ago

Problem Description

I am using AIR SDK 50.0.1.1. To make things simpler, I am using the starling 2.7 demo_mobile project. I am getting this error on iOS devices, whether installing or debugging them from FlashBuilder:

TypeError: Error #1034: Type Coercion failed: cannot convert flash.utils:: Dictionary@106528fa1 to flash.utils.Proxy. at starling.assets::AssetManager/addAsset()[/Users/redge/Development/starling/starling/src/starling/assets/AssetManager.as:578] at Function/onAssetLoaded()[/Users/redge/Development/starling/starling/src/starling/assets/AssetManager.as:399] at Function/onAssetLoaded() at Function/complete()[/Users/redge/Development/starling/starling/src/starling/assets/BitmapTextureFactory.as:89] at Function/complete() at global/starling.utils::execute()[/Users/redge/Development/starling/starling/src/starling/utils/execute.as:28] at Function/Texture.as$3:anonymous()[/Users/redge/Development/starling/starling/src/starling/textures/Texture.as:346] at Function/Texture.as$3:anonymous() at global/starling.utils::execute()[/Users/redge/Development/starling/starling/src/starling/utils/execute.as:28] at ConcreteRectangleTexture/onTextureReady()[/Users/redge/Development/starling/starling/src/starling/textures/ConcreteRectangleTexture.as:107] at ConcreteRectangleTexture/onTextureReady()

It seems to run fine on Android, however.

Steps to Reproduce

It happens on startup of the demo project when loading assets.

Here is a snippet of the starling AssetManager code where it is happening.

    public function addAsset(name:String, asset:Object, type:String=null):void
    {
        type ||= AssetType.fromAsset(asset);

        *** THIS IS WHERE IT CRASHES ***
        var store:Dictionary = _assets[type];
        if (store == null)
        {
            store = new Dictionary();
            _assets[type] = store;
        }

        log("Adding " + type + " '" + name + "'");

        var prevAsset:Object = store[name];
        if (prevAsset && prevAsset != asset)
        {
            log("Warning: name was already in use; disposing the previous " + type);
            disposeAsset(prevAsset);
        }

        store[name] = asset;
    }
ajwfrost commented 1 year ago

Interesting... I assume this wasn't an issue on 33.1.x so it's most likely caused by a change in the AOT compiler. We've not specifically changed anything here but it's presumably a side effect of another update... we'll check this one out...

thanks

braintrain727 commented 1 year ago

Correct, it was not an issue on 33.1.x.

ajwfrost commented 1 year ago

Ah ... and are you building from Windows? I just tried this from macOS and it worked fine. Seems to be the aot-compiler rather than anything else, will have to look at this more...

braintrain727 commented 1 year ago

Yes, Windows 10 64-bit.

ajwfrost commented 1 year ago

Hi

New files to be put into the SDK under the lib\aot\bin\compile-abc\ folder please.. (worth just checking they're signed by Harman before running them..) -> this should fix the problem here I believe.. We'll be doing an updated release before too long anyway but in case it helps, thought I'd post them here too! Valid for any 50.0 release..

compile-abc.zip

thanks

braintrain727 commented 1 year ago

I accidentally forgot to add a comment. This seems to have fixed it.

ajwfrost commented 1 year ago

Great, thanks for confirming..

pavelzmolik commented 1 year ago

I also had strange bug with XML.. only with regular AIR 50 on iOS device, not happening on device for 33.1.xxx(or with testing in Animate on Windows 10) - that patch fixed it.. I just describe my XML bug

I cant use XMLList because I cant use it by "for each" loop, because new XML variable with value must be created by "new XML" same XMLList must be created by "new XMLList(value)"

so let be some this XML

the parsing code correctly functional in 33.1.xxx and NOW in 50(AFTER PATCH) var __xml:XML=new XML(PARSED_XML_FILE); var xList:XMLList; var _poleKategorii:Array=new Array()xList=__xml.kategorie; for each(var r:XML in xList){ o=new Object(); o.cat_id=String(r.@id); o.cat_label=String(r.@label_name); _poleKategorii.push(o); };

In regular AIR 50 this code not working. I had to use this workaround: for(var i:int=0;i<__xml.kategorie.length();i++){ o=new Object(); o.cat_id=String(__xml.kategorie[i].@id); o.cat_label=String(__xml.kategorie[i].@label_name); _poleKategorii.push(o); } Unfortunately, i cant use it on older applikactions.. so I have been desperate.. but glad to see, Harman fixed it.. cool