airsdk / Adobe-Runtime-Support

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

AIR SDK 758 - Error: Definition flash.html.script could not be found #1622

Closed makanmel closed 1 year ago

makanmel commented 2 years ago

I have updated to the newest AIR SDK 758 overlaying it on top of the Flex SDK:

<name>Apache Flex 4.15.0 FP20.0 AIR20.0 en_US</name>
<version>4.15.0</version>
<build>20160104</build>

And the project started to fail during ANT build with the next error for every mxml file in the project:

...
    [compc] ...\...\MyMainWindow.mxml(-1):  Error: Definition flash.html.script could not be found.
    [compc]
    [compc] <?xml version="1.0" encoding="utf-8"?>
    [compc] ...\...\MySecondaryWindow.mxml(-1):  Error: Definition flash.html.script could not be found.
    [compc]
    [compc] <?xml version="1.0" encoding="utf-8"?>
    [compc] ...\...\MsgBoxComponent.mxml(-1):  Error: Definition flash.html.script could not be found.
    [compc]
    [compc] <?xml version="1.0" encoding="utf-8"?>
    [compc]
...

Also reproducible with the sample mobile project in the Intellij IDEA:

File - New - Project - Flash Target Platform: Mobile Output type: Application

Screenshot_3 Screenshot_4

2jfw commented 2 years ago

To me it looks like Flex's WindowedApplication has a reference to HTML in function menuItemSelectHandler.

const html:HTML = new HTML(); [Line 2664]

Same class also:

private function viewSourceResizeHandler(html:HTML):Function [Line 3510]

ajwfrost commented 2 years ago

Thanks for this ... so it turns out, the Flex compiler is always adding a set of implicit "import" statements to the start of every file it compiles, and because we'd removed some of the html capabilities, this part is failing.

The new HTML should be ok as this is mx.controls.HTML which imports the below three classes:

import flash.html.HTMLLoader;
import flash.html.HTMLHistoryItem;
import flash.html.HTMLHost;

and these still exist, albeit with restricted functionality...

Will just recreate an airglobal.swc with the class from the 'flash.html.script' package and check that this solves it..

ajwfrost commented 2 years ago

Can you try replacing the airglobal.swc, in frameworks/libs/air/, with the one in the below zip please? thanks airglobal.zip

makanmel commented 2 years ago

Can you try replacing the airglobal.swc, in frameworks/libs/air/, with the one in the below zip please? thanks airglobal.zip

The new airglobal.swc helped and now the project compiles without errors. Thank you.