Closed cgascons closed 5 years ago
With a complex project structure like that, it's likely that you are running into some known issues in version 0.9.4 of the Apache Royale compiler. This is the current version included with the VSCode extension to power the code intelligence (even for projects that use other SDKs).
The issues have been fixed in the upcoming version 0.9.6 of Royale. I plan to include this update as soon as it is released. However, you can start using it today by downloading the SDK and changing a setting in VSCode, of you'd like.
Go here: https://royale.apache.org/download/
Find the "JSOnly Nightly Build" near the bottom of the page. Download apache-royale-0.9.6-bin-js.zip on Windows or apache-royale-0.9.6-bin-js.tar.gz on macOS, and extract it somewhere.
In VSCode, set the as3mxml.sdk.editor
setting to the royale-asjs folder inside the unzipped SDK. Note that this is different from the as3mxml.sdk.framework
setting that you use to point to your project's SDK.
... Find the "JSOnly Nightly Build" near the bottom of the page. Download apache-royale-0.9.6-bin-js.zip on Windows or apache-royale-0.9.6-bin-js.tar.gz on macOS, and extract it somewhere. ...
Wow! This finally solved all my 1000s of Problems and Royale's NullPointerExceptions connected to unknown compiler defines (https://github.com/BowlerHatLLC/vscode-as3mxml/issues/370). Thanks again for all your hard work!
@jnpatrick99 Great news! I think the null pointer exceptions with unknown defines is a bug that I just fixed in the compiler this morning. 😎
@joshtynjala This is so far looking promising indeed, I just downloaded the new package and seems to be working fine! I will let you know if I run into more related issues. Thanks!
Hey @joshtynjala, sorry to re-open this. I've actually got a question regarding the workspace organization, please let me know if you need me to open a new issue for this and I will do it.
Is there a way to force using a specific asconfig.json file to attach a swf to a mobile device for debugging?
I'm using the stated configuration above, and I'm having a hard time trying to debug on an android device my project. Creating a release and attaching it manually to device works fine, as well as debugging on simulator, but when I select the "Install and Attach (Android)" debug task I get an error that says:
Preparing to install Adobe AIR application...
Failed to debug SWF. Error reading application <id> in application descriptor for platform "android".
This error goes away when in the root asconfig.json
file (the one I also pasted above) I set the application
attribute to: _android/src/MainGame-app.xml
. Which has already been set in asconfig-android.json
but seems to be ignoring.
Any advice?
This is the launch.json task that I believe is not working properly:
{
"type": "swf",
"request": "attach",
"name": "Install and Attach (Android)",
"platform": "android",
"connect": true
}
Thanks beforehand!
There's not currently a way to tell it to use a different asconfig file for launch. It will only use the main asconfig.json. I created #386 to make this more configurable.
Thank you Josh, we will wait for it, I do believe it will help us.
Hi,
I'm trying to setup my workspace but I'm finding some issues. I have read many related issues but none seem to point me in the right direction and I'm hitting a wall.
My current situation is as follows:
We did separate these libraries in projects when using Flash Builder because of their sdk nature.
Our current workspace on FlashBuilder was quite heavy, each library and each game platform is a project, so: 5 games x 4 platforms + 5 libraries = 25 projects.
My intention using VS was to have it all clean and tidy, my current setup is the following:
1 - I created one workspace per library so that's 5 VS projects, so far so good. 2 - I think it would be nice to have 1 workspace per game and have 4 folders inside, one per platform so something like this:
Inside of each of the platform folders I have their bin and src folders. On the workspace root I created one asconfig.json per platform as well as a default asconfig.json for the workspace itself. Also, the launch.json file contains all the setups for each platform, which is awesome.
My intention is to be able to debug the games and be able to access (or set breakpoints on) the source code of my libraries, so the only way that I believe I have to access it is by adding their
src
folders into thesource-path
compiler option.I have been playing around for a while and my current setup allows me to launch/debug every platform just fine, the problem comes when I try to access any .as file of any of the previously attached sources.
I had to add this to asconfig.json in order to reach my current state:
As you can see to make this work I have also had to create a src/MainEmpty class which does simply nothing, it's empty.
I can (sometimes!) access the classes of the libraries, some other times I start getting errors (up to 30k+) and after deleting a blank space and saving the workspace they banish, not quite sure what's going on to be honest. Also, from time to time when Pressing Ctrl + T to access an actionscript source class the class itself seems to be extracted from an already compiled swc which only shows me the headers of the functions in it, quite weird.
Sample of an error:
Any ideas of what could I do to make this work? I don't care if I have to separate each platform into a separate VS project, I tried it already but still found the same errors though.
Any help will be appreciated.