royale-asjs
royale-asjs copied to clipboard
fx:Array tag could not be resolved to an ActionScript class.
Since this morning, I cannot compile my Apache Royale projects, the error is located when trying to use the Array class from the adobe fx package ...
<?xml version="1.0" encoding="utf-8"?>
<crux:BeanProvider xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:crux="library://ns.apache.org/royale/crux"
xmlns:mx="library://ns.apache.org/royale/mx"
xmlns:a="library://ns.test.com/test">
<fx:Script>
<![CDATA[
import com.test.beads.services.DynamicChannelSet;
import mx.messaging.config.LoaderConfig;
override public function initialize():void{
super.initialize();
}
override public function generateMXMLAttributes(data:Array):void
{
LoaderConfig.init(null);
super.generateMXMLAttributes(data);
}
]]>
</fx:Script>
<mx:RemoteObject id="WPWebService" destination="fluorine" channelSet="{loginChannel}" />
<crux:Bean id="dynamicChannels">
<crux:source>
<fx:Array>
<a:DynamicChannelSet id="loginChannel" />
</fx:Array>
</crux:source>
</crux:Bean>
</crux:BeanProvider>
Console log:
This tag could not be resolved to an ActionScript class. It will be ignored.
<fx:Array>
^
Hi Javier, probably this is related to the changes we are doing in the maven distribution (if you're using it) We are still working on it. You probably need to update to this commit: 3aa93d41d54c44c5cbb84e3950980b8eaa002931 Since we are now working on the swf side
I have my development branch updated https://github.com/apache/royale-asjs/commit/c2a7d5e4761c37d1baddeb6b0cb2d897f45a28db but i still have the same problem.
Is there a temporary solution to be able to continue working?
Hi Javier,
I build all today (without latest Josh changes about player global generation). Then build todomvc-crux-jewel example with maven and with maven sdk distribution in vscode and all worked fine.
Then I added this to Beans.mxml:
<crux:Bean id="dynamicChannels">
<crux:source>
<fx:Array>
<fx:Object/>
</fx:Array>
</crux:source>
</crux:Bean>
And still build ok. So can't find any issue. How you're building?
It seems that the problem only appears with "libraries". Let's see if I have time later and try to pass todomvc-crux-jewel to the library and app ... I'll tell you how it looks.
Hiedra
ok, so the problem is to have an mxml in a library that uses a fx:Array (and I guess any other fx:Object), right? This was working before latest changes in Royale?
Yes, as additional information we have these classes in a separate project as a library. In fact, if I move the class to the main project, it compiles correctly.
Hi @javeiga-iest, @chrisdutz asked about issues with current maven distro and I want to ask you if this problem still remains. I saw an email from Maria Jose yesterday that I didn't understand completely and could mean that problem is solved. Please let us know.
By adding the following line to the additionalCompilerOptions statement apparently solves the problem:
-compiler.js-namespaces.namespace+=http://ns.adobe.com/mxml/2009,${env.ROYALE_HOME}/frameworks/mxml-2009-manifest.xml;
What we do not know if it is the correct solution, because before the changes of the SDK, our library took the reference correctly.
For now, i leave this answer as a solution and close the issue
Ok Thanks. I think we need to add something to a royale-config in maven probably
Reopening because that's a workaround and not the solution. Using classes like <fx:Array> in MXML should "just work" without any extra configuration.
The truth is that I do not know if it is "the correct patch". I have applied it to 2 projects and in one it works perfectly and in the other it causes an error in runtime when loading App:


I don't think this is a "valid patch"
Hiedra.
Sorry, I forgot to point out that the error occurs when loading the BeanProvider in App.mxml (the code is in Jose's first email). This Beanprovider is where <fx: Array> is referenced, in the library. What a coincidence!!!
Hiedra
Hi, probably the problem with one lib project working and the other not was a hidden problem that was not shown with the older config. The patch seems valid to me, but we need to solve at SDK level so you can remove it.
Is there a demo application I your use to replicate the problem?
The strange thing is that the royale-config lists the manifest you manually added ... so not quite sure why this has any effect at all.
Chris, I got this email and it spammed me “apache/royale-asjs [email protected]mailto:[email protected]>” , sorry, I didn't read it ...
Yes, there is an example application that Carlos has created and I have made some changes ... https://github.com/mjesteve/royale-asjs/tree/Example_AppWithLib
Hope this can help you Hiedra
De: Christofer Dutz [email protected] Enviado el: domingo, 28 de febrero de 2021 12:25 Para: apache/royale-asjs [email protected] CC: Maria Jose Esteve [email protected]; Comment [email protected] Asunto: Re: [apache/royale-asjs] fx:Array tag could not be resolved to an ActionScript class. (#1083)
Is there a demo application I your use to replicate the problem?
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/apache/royale-asjs/issues/1083#issuecomment-787436545, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANJL3U45HTJ33MZTZ5YQJZDTBIRXDANCNFSM4YA34VEQ.
Compiling the previous version of the SDK we still have problems, can it have something to do with the artifacts that are downloaded regardless of the version compiled locally? Is there a way to properly compile the old version?
I'm currently actually completely rewriting the distribution process for maven. It turned out a lot of the static resources in the maven distribution were out of sync with the ones in the ANT distribtion. In order to prevent that, I'm going to take the ANT versions and convert them to be compatible with the Maven version ... hopefully I'll also be able to add the project sources so you don't need to double add the SDKs for debugging ... however with is going to take a few more days (As I can only work on this in my free time)
@chrisdutz please do this on the branch, so we could test it with our projects. Thanks!
It's all on the branch: "feature/distribution-alignment" (Now that I know that the Maven distribution is being used .. I'm a bit more careful ;-) ) ... but a lot of not committed stuff right now ... gotta get the time to reach a checkpoint first or I'll just be pushing broken stuff.
Chris, I can't generate the maven distribution with your branch (There are so many emails that I don't know where to reply ...):
[INFO] mxmlc .............................................. SUCCESS [ 0.336 s] [INFO] Apache Royale: Distribution ........................ FAILURE [ 0.684 s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 01:33 min [INFO] Finished at: 2021-03-02T17:21:32+01:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal on project distribution: Could not resolve dependencies for project org.apache.royale.framework:distribution:pom:0.9.8-SNAPSHOT: Could not find artifact org.apache.royale.compiler:compiler:jar:scripts:0.9.8-SNAPSHOT in apache.snapshots (https://repository.apache.org/snapshots) -> [Help 1]
Does it work for any of you?
Hi
Have you also checked out and built the same branch in compiler and typedef repo? It needs changes in those too.
Chris
I don't think she need to do that. In general all the stuff should be reachable from maven central. Above issue is well known to me, I cannot in 100% that this is the case, but in general - there 100% reproducibility on my PC and several other one with Windows.
- You are trying to build, downloading some artifacts cause they were rebuild on the server
- Download has been failed for some of them - randomly
- Trying one more time build stuff - the same artifacts are being download correctly
Sometimes build needs 3 attempts to have all artifacts downloaded and reach real building. @mjesteve please try again.
But she said in my branch ... I created an additional artifact in the compiler module to pack up all the scripts. As it's only in a branch it's not available from the Apache repo. Same with the ACE typedef ... that should only be available in my feature-branch. And both are needed for my updated distribution.
It is true Piotr, there are times that I have to launch the compilation several times for it to be successful, this time I did not have the precaution to do it ... With the synced branches of royale-compiler and royale-typedefs, without touching anything else, it compiled me ok. Now I'm going to test the SampleLib sample project and tell you about it. Hiedra.
But please ... it's still a work in progress ;-) ... of course I would be super happy for feedback that everything is working ... but please don't expect it to :-) But always happy for feedback.
Hahahaha, Of course Chris, I do it to give you feedback, to help a little. You tell me the tests that you need that I do.
Hiedra.
Ööööhm ... well right now: Use the new distribution and tell me what doesn't work ;-)
The swc's are created in the js/libs folder:

But in royale-config.xml you reference libs directly:

Hiedra.
I just compared the version generated by the maven distribution and the ant distribution and they are effectively equal (Except little naming cleanups I added to the maven version)
However I just pushed some changes and I was working on exactly the "path-element" cleaning ... so perhaps what you reported is already fixed. Could you please update (just need asjs) and give it another try?
Right now I also would say that I have finished all the things I knew needed doing.