BowlerHatLLC / vscode-as3mxml

ActionScript & MXML language extension for Visual Studio Code. Develop apps for Adobe AIR, Adobe Flash Player, or Apache Royale.
https://as3mxml.com/
Apache License 2.0
256 stars 39 forks source link

application descriptor not found #454

Closed Shaunmax closed 4 years ago

Shaunmax commented 4 years ago

I am unable to debug swf for my adobe air mobile project, tried both swf and simulator, getting same error!

Error launching SWF debug session. Process exited with code: 6

Process terminated without establishing connection to debugger.

application descriptor not found

asconfig.json :-

{
    "config": "airmobile",
    "compilerOptions": {

        "source-path": [
            "src"
        ],
        "library-path": [
            "/Users/myMacName/Documents/myAppName/native_extensions/ANE-Adverts/lib/com.distriqt.Adverts.ane",
            "/Users/myMacName/Documents/myAppName/native_extensions/ANE-Application/lib/com.distriqt.Application.ane",
            "/Users/myMacName/Documents/myAppName/native_extensions/ANE-ApplicationRater/lib/com.distriqt.ApplicationRater.ane",
            "/Users/myMacName/Documents/myAppName/native_extensions/ANE-Bolts/lib/com.distriqt.Bolts.ane",
            "/Users/myMacName/Documents/myAppName/native_extensions/ANE-Core/lib/com.distriqt.Core.ane",
            "/Users/myMacName/Documents/myAppName/native_extensions/ANE-FacebookAPI/lib/com.distriqt.FacebookAPI.ane",
            "/Users/myMacName/Documents/myAppName/native_extensions/ANE-Firebase/lib/com.distriqt.Firebase.ane",
            "/Users/myMacName/Documents/myAppName/native_extensions/ANE-Firebase/lib/com.distriqt.firebase.Auth.ane",
            "/Users/myMacName/Documents/myAppName/native_extensions/ANE-Firebase/lib/com.distriqt.firebase.Database.ane",
            "/Users/myMacName/Documents/myAppName/native_extensions/ANE-Firebase/lib/com.distriqt.firebase.Firestore.ane",
            "/Users/myMacName/Documents/myAppName/native_extensions/ANE-Firebase/lib/com.distriqt.firebase.RemoteConfig.ane",
            "/Users/myMacName/Documents/myAppName/native_extensions/ANE-Firebase/lib/com.distriqt.firebase.Storage.ane",
            "/Users/myMacName/Documents/myAppName/native_extensions/ANE-GoogleAnalytics/lib/com.distriqt.GoogleAnalytics.ane",
            "/Users/myMacName/Documents/myAppName/native_extensions/ANE-InAppBilling/lib/com.distriqt.InAppBilling.ane",
            "/Users/myMacName/Documents/myAppName/native_extensions/ANE-Message/lib/com.distriqt.Message.ane",
            "/Users/myMacName/Documents/myAppName/native_extensions/ANE-PushNotifications/lib/OneSignal/com.distriqt.PushNotifications.OneSignal.ane",
            "/Users/myMacName/Documents/myAppName/native_extensions/ANE-SquareLibs/lib/com.distriqt.square.okhttp.ane",
            "/Users/myMacName/Documents/myAppName/native_extensions/ANE-ZipUtils/lib/com.distriqt.ZipUtils.ane",
            "/Users/myMacName/Documents/myAppName/native_extensions/AndroidFullScreen.ane",
            "/Users/myMacName/Documents/myAppName/native_extensions/ANESounds.ane",
            "/Users/myMacName/Documents/myAppName/native_extensions/flox-as3-1.2.1/Flox-AS3.swc",
            "/Users/myMacName/Documents/myAppName/native_extensions/greensock.swc",
            "/Users/myMacName/Documents/myAppName/native_extensions/aircore.swc",
            "/Users/myMacName/Documents/myAppName/native_extensions/stardust-library.swc",
            "/Users/myMacName/Documents/myAppName/native_extensions/stardust-sim-loader.swc",
            "/Users/myMacName/Documents/myAppName/native_extensions/as3-signals-v0.8.swc",
            "/Users/myMacName/Documents/myAppName/native_extensions/ANE-CustomResources-master/build/com.distriqt.CustomResources.ane"
        ],
        "output": "bin/myAppName.swf"
    },
    "mainClass": "myAppName",
    "application": "src/myAppName-app.xml",
    "airOptions": {
        "extdir": [
            "/Users/myMacName/Documents/myAppName/native_extensions"
        ],
        "files": [
            {
                "file": "/Users/myMacName/Documents/myAppName/src/ext_assets",
                "path": "ext_assets"
            }
        ]
    }
}

launch.json ;-

{
    // Use IntelliSense to learn about possible SWF debug attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
                "type": "swf",
                "request": "launch",
                "name": "Launch SWF",
                "profile": "mobileDevice",
                "screensize": "iPhoneRetina",
                "screenDPI": 326,
                "versionPlatform": "IOS"
        }
    ]
}

task.json :-

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "type": "actionscript",
            "debug": true,
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}
joshtynjala commented 4 years ago

After you run your build task, does bin/myAppName-app.xml exist?

joshtynjala commented 4 years ago

This error can also be displayed if src/myAppName-app.xml contains invalid XML, so it may be worth checking if it's valid or not.

Shaunmax commented 4 years ago

Here is the xml

<?xml version="1.0" encoding="utf-8" ?>
<application xmlns="http://ns.adobe.com/air/application/32.0">
    <id>com.example.myAppName </id>
    <versionNumber>0.0.0</versionNumber>
    <filename>myAppName </filename>
    <name>myAppName </name>
    <initialWindow>
        <content>[Path to content will be replaced by Visual Studio Code]</content>
        <visible>true</visible>
    </initialWindow>
</application>
Shaunmax commented 4 years ago

After you run your build task, does bin/myAppName-app.xml exist?

Nope! its empty! Also in terminal its :- The terminal process terminated with exit code: 2

Terminal will be reused by tasks, press any key to close it.

joshtynjala commented 4 years ago

The terminal process terminated with exit code: 2 Terminal will be reused by tasks, press any key to close it.

Since there's an exit code, that means that the build task failed. There's no point in trying to debug until your build completes successfully. Are there any additional errors in the terminal before it prints the exit code?

Shaunmax commented 4 years ago

yes! but those are warnings! in the terminal they are shown as errors​! warnings like type not declared, return type not mentioned etc

On Tue 25 Feb, 2020, 00:22 Josh Tynjala, notifications@github.com wrote:

The terminal process terminated with exit code: 2 Terminal will be reused by tasks, press any key to close it.

Since there's an exit code, that means that the build task failed. Are there any additional errors in the terminal before it prints the exit code?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/BowlerHatLLC/vscode-as3mxml/issues/454?email_source=notifications&email_token=AD6PAMUDKZDZYBY2INM2VK3REQJNLA5CNFSM4K2M5K32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMZCUTA#issuecomment-590490188, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD6PAMQK2BTM2XM42QFLJNLREQJNLANCNFSM4K2M5K3Q .

joshtynjala commented 4 years ago

It wouldn't exit with a code if there weren't an error, and warnings are different from errors. Are there a lot of warnings? It can be easy to miss a real error in the middle. I once had to work on a project a project that was reporting dozens of errors, and it was sometimes very difficult to a single error that caused the build to fail.

Shaunmax commented 4 years ago

in the problem panel i have 100+ warnings but no errors​!

On Tue 25 Feb, 2020, 00:51 Josh Tynjala, notifications@github.com wrote:

It wouldn't exit with a code if there weren't an error. Are there a lot of warnings? It can be easy to miss an error in the middle. I once had to work on a project a project that was reporting dozens of errors, and it was sometimes very difficult to a single error that caused the build to fail.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/BowlerHatLLC/vscode-as3mxml/issues/454?email_source=notifications&email_token=AD6PAMQH5R6E6F6LI4YUBA3REQM37A5CNFSM4K2M5K32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMZF6OQ#issuecomment-590503738, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD6PAMRHRKH6KOBGYNSAUM3REQM37ANCNFSM4K2M5K3Q .

joshtynjala commented 4 years ago

Depending on which SDK you are using, there may sometimes be errors in the terminal that do not appear in the problems panel.

Shaunmax commented 4 years ago

Depending on which SDK you are using, there may sometimes be errors in the terminal that do not appear in the problems panel.

Yes! you are right! I have an error in terminal

/Users/myMacName/Documents/myAppName/src/com/shortybmc/utils/StringUtils.as:1 Error: Unexpected character. '' is not allowed here package com.shortybmc.utils

but I can't identify the error!

package com.shortybmc.utils
{

    public class StringUtils
    {

        public static var NEWLINE_TOKENS : Array = new Array ('\n','\r');

        public static var WHITESPACE_TOKENS : Array = new Array (' ','\t');

         /*
         * Counts the occurrences of needle in haystack. <br />
         * {@code trace (StringUtils.count ('hello world!', 'o')); // 2
         * }
         * @param haystack :String
         * @param needle :String
         * @param offset :Number (optional)
         * @param length :Number (optional)
         * @return The number of times the needle substring occurs in the
         * haystack string. Please note that needle is case sensitive.
         */
        public static function count ( haystack : String, needle : String, offset : Number = 0, length : Number = 0 ) : Number
        {
            if ( length === 0 )
                 length = haystack.length
            var result : Number = 0;
            haystack = haystack.slice( offset, length );
            while ( haystack.length > 0 && haystack.indexOf( needle ) != -1 )
            {
                haystack = haystack.slice( ( haystack.indexOf( needle ) + needle.length ) );
                result++;
            }
            return result;
        }

        /**
         * Strip whitespace and newline (or other) from the beginning and end of a string. <br />
         * {@code trace (StringUtils.trim ('hello world! ')); // hello world!
         * }
         * @param str :String
         * @param charList :Array (optional)
         * @return A string with whitespace stripped from the beginning and end
         * of str. Without the second parameter, trim() will strip characters that
         * defined in WHITESPACE_TOKENS and NEWLINE_TOKENS array.
         */
        public static function trim ( str : String, charList : Array = null ) : String
        {
            var list : Array;
            if ( charList )
            {
                list = charList;
            }
            else
            {
                list = WHITESPACE_TOKENS.concat( NEWLINE_TOKENS );
            }
            str = trimLeft( str, list );
            str = trimRight( str, list );
            return str;
        }

        /**
         * Does the same how trim method, but only on left-side. <br />
         * {@code trace (StringUtils.trimLeft ('hello world!')); // hello world!
         * }
         * @param str :String
         * @param charList :Array (optional)
         * @return A string with whitespace stripped from the start of str.
         * Without the second parameter, trimLeft() will strip haracters of
         * WHITESPACE_TOKENS + NEWLINE_TOKENS.
         */
        public static function trimLeft ( str : String, charList : Array = null ) : String
        {
            var list:Array;
            if ( charList )
                 list = charList;
            else
                 list = WHITESPACE_TOKENS.concat( NEWLINE_TOKENS );

            while ( list.toString().indexOf ( str.substr ( 0, 1 ) ) > -1 && str.length > 0 )
            {
                str = str.substr ( 1 );
            }
            return str;
        }

        /**
         * Does the same how trim method, but only on right-side. <br />
         * {@code trace (StringUtils.trimRight ('hello world!')); // hello world!
         * }
         * @param str :String
         * @param charList :Array (optional)
         * @return A string with whitespace stripped from the end of str.
         * Without the second parameter, trimRight() will strip haracters of
         * WHITESPACE_TOKENS + NEWLINE_TOKENS.
         */
        public static function trimRight ( str:String, charList : Array = null ) : String
        {
            var list : Array;
            if ( charList )
                 list = charList;
            else
                 list = WHITESPACE_TOKENS.concat( NEWLINE_TOKENS );

            while ( list.toString().indexOf ( str.substr ( str.length - 1 ) ) > -1 && str.length > 0)
            {
                str = str.substr ( 0, str.length - 1 );
            }
            return str;
        }

    }
}
joshtynjala commented 4 years ago

I copied Error: Unexpected character. '' is not allowed here into my local editor. Using the left/right arrow keys on my keyboard, I can determine that some kind of invisible character is between the two ' symbols. I need to press the arrow key twice to get past it.

That may be tricky for you to solve. If I had to guess it may be a UTF byte order mark (BOM). I would try copying and pasting the contents of StringUtils.as into a different file. Then, delete the original StringUtils.as. Save the new file in its place. If that doesn't work, you'll need to search for a solution for removing the BOM character. I'm sure that there's a relatively easy solution out there.

Shaunmax commented 4 years ago

I copied Error: Unexpected character. '' is not allowed here into my local editor. Using the left/right arrow keys on my keyboard, I can determine that some kind of invisible character is between the two ' symbols. I need to press the arrow key twice to get past it.

That may be tricky for you to solve. If I had to guess it may be a UTF byte order mark (BOM). I would try copying and pasting the contents of StringUtils.as into a different file. Then, delete the original StringUtils.as. Save the new file in its place. If that doesn't work, you'll need to search for a solution for removing the BOM character. I'm sure that there's a relatively easy solution out there.

Thanks for the fix! Actually I tried that but the issue persisted! Upon enquiring the same in starling forum, JohnBlackburne suggested to check the same in BBedit, and yes there was a blank space in front of package! So upon removing it, everything works fine!