Code Monkey home page Code Monkey logo

Comments (16)

j3k0 avatar j3k0 commented on May 16, 2024

Error #2004 is triggered by Air because a call to a method didn't get the correct set of parameters. I will try to run using SDK 33.1.1.554 (I was using 575)


Update: I get the same error with AIR SDK 554.

from apm.

marchbold avatar marchbold commented on May 16, 2024

Hi, Sounds like a bug in our code initiating the manifest merge. Do you just have starling installed? It may be that there's nothing for the merge to do, I'll double check it correctly handles that case.

from apm.

marchbold avatar marchbold commented on May 16, 2024

Have you modified the apm script at all? The only way i can get that error is if i remove the -workingdir arg from the adl call

I'm going to add some checks to make sure it's set correctly.

from apm.

j3k0 avatar j3k0 commented on May 16, 2024

No, I'm using the latest apm from github releases.

$ cat ~/Fovea_AIR_Toolchains/apm/apm
#!/bin/bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
#$SCRIPT_DIR/apm.app/Contents/MacOS/apm -workingdir "`pwd`" $@
adl -profile extendedDesktop -cmd "$SCRIPT_DIR/apm.xml" -- -workingdir "`pwd`" -appdir "$SCRIPT_DIR" $@

$ ~/Fovea_AIR_Toolchains/apm/apm generate app-descriptor
Android package name: com.example.project
⣾ Android manifest merging
generate/app-descriptor :: Error #2004: One of the parameters is invalid.

$ cat project.apm
{
    "identifier": "com.example.project",
    "name": "Project",
    "version": "1.0.0"
}

from apm.

marchbold avatar marchbold commented on May 16, 2024

What else is in your working directory?

from apm.

j3k0 avatar j3k0 commented on May 16, 2024
verity:test-apm jeko$ ls
project.apm  setenv
verity:test-apm jeko$ cat project.apm
{
    "identifier": "com.example.project",
    "name": "Project",
    "filename": null,
    "version": "1.0.0",
    "versionLabel": null,
    "dependencies": [],
    "configuration": {},
    "repositories": [],
    "deployOptions": {}
}
verity:test-apm jeko$ cat setenv
nvm use v12
export PATH="~/Fovea_AIR_Toolchains/air-33.1.1.575/bin:~/Fovea_AIR_Toolchains/apm:$PATH"
verity:test-apm jeko$ ~/Fovea_AIR_Toolchains/apm/apm generate app-descriptor
Android package name: air.com.example.project
⣾ Android manifest merging
generate/app-descriptor :: Error #2004: One of the parameters is invalid.
verity:test-apm jeko$ DEBUG=1 ~/Fovea_AIR_Toolchains/apm/apm generate app-descriptor
SCRIPT_DIR: /Users/jeko/Fovea_AIR_Toolchains/apm
PWD: /Users/jeko/Documents/triominos/test-apm
ARGS: generate app-descriptor
Android package name: air.com.example.project
⣾ Android manifest merging
generate/app-descriptor :: Error #2004: One of the parameters is invalid.

Notice, I'm now editing apm to add some logs when DEBUG=1 (SCRIPT_DIR, PWD, ARGS, ...)

Also, $@ should be quoted when calling adl, only matters if one of the arguments has a space in it (might happen with directories).

from apm.

j3k0 avatar j3k0 commented on May 16, 2024

My edited version of apm script:

#!/bin/bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
#$SCRIPT_DIR/apm.app/Contents/MacOS/apm -workingdir "`pwd`" $@

if [ "x$DEBUG" = "x1" ]; then
  echo "SCRIPT_DIR: $SCRIPT_DIR"
  echo "PWD: $( pwd )"
  echo "ARGS: $@"
fi

adl -profile extendedDesktop -cmd "$SCRIPT_DIR/apm.xml" -- -workingdir "$( pwd )" -appdir "$SCRIPT_DIR" "$@"

from apm.

marchbold avatar marchbold commented on May 16, 2024

So this is happening when you have no packages installed, and have just run apm init

Can you run it as below:

apm -l debug generate app-descriptor

Must be picking up something weird in the env...

from apm.

j3k0 avatar j3k0 commented on May 16, 2024

It's happening in both cases, I first tried after having installed starling (as an experiment), then right after apm init, then after removing the null in the generated project file (which I though might cause issues).

Trying to build apm from source so I can dig in deeper (cf other issue).

from apm.

j3k0 avatar j3k0 commented on May 16, 2024

Still in an empty directory only containing the project.apm file after an apm init:

$ apm -l debug generate app-descriptor
D::Log::setLogLevel( debug )
D::RunConfig::loadEnvironment()
D::ProcessQueue::checkAndStartNextProcess(): 3
D::LoadMacOSEnvironmentVariablesProcess::start()
D::LoadMacOSEnvironmentVariablesProcess::Process exited with: 0
D::ProcessQueue::process_eventHandler( process_complete )
D::ProcessQueue::checkAndStartNextProcess(): 2
D::LoadProjectDefinitionProcess::start()
D::LoadProjectDefinitionProcess::found project file - loading ...
D::ProcessQueue::process_eventHandler( process_complete )
D::ProcessQueue::checkAndStartNextProcess(): 1
D::LoadUserSettingsProcess::start()
D::ProcessQueue::process_eventHandler( process_complete )
D::ProcessQueue::checkAndStartNextProcess(): 0
D::GenerateAppDescriptorCommand::execute(): ...

D::ProcessQueue::checkAndStartNextProcess(): 4
D::ProcessQueue::checkAndStartNextProcess(): 2
D::ProcessQueue::process_eventHandler( process_complete )
D::ProcessQueue::checkAndStartNextProcess(): 1
Android package name: air.com.example.project
⣾ Android manifest merging
D::ProcessQueue::process_eventHandler( process_failed )
D::ProcessQueue::process_eventHandler( process_failed )
generate/app-descriptor :: Error #2004: One of the parameters is invalid.

from apm.

marchbold avatar marchbold commented on May 16, 2024

That error Error #2004: One of the parameters is invalid. is normally from the File constructor when an invalid path is passed in.

from apm.

marchbold avatar marchbold commented on May 16, 2024

This is normally only done with the config paths, mainly the working directory, hence the question about the script etc.

from apm.

j3k0 avatar j3k0 commented on May 16, 2024

Just, in case, I tried running from a different directory and get the same error:

verity:tmp jeko$ cd /tmp
verity:tmp jeko$ mkdir xxx
verity:tmp jeko$ cd xxx/
verity:xxx jeko$ apm init
Creating new project definition file
Application Identifier [com.my.app]:
Application Name [My Application]:
Application Version [1.0.0]:
verity:xxx jeko$ apm generate app-descriptor
Android package name: air.com.my.app
⣾ Android manifest merging
generate/app-descriptor :: Error #2004: One of the parameters is invalid.

from apm.

j3k0 avatar j3k0 commented on May 16, 2024

FYI, I'm digging into the source code now. The error is triggered by APM.config.getJava();

from apm.

j3k0 avatar j3k0 commented on May 16, 2024

This issue was fixed by setting JAVA_HOME=/usr/ - I'll make a PR to have getJava() try this by default when JAVA_HOME is not set.

from apm.

marchbold avatar marchbold commented on May 16, 2024

Ah, yep that function definitely needs work, doesn't look to handle errors correctly at all currently.. I'm working on another release now so I'll put some better handling in there for it.

from apm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.