0

It has been awhile since I updated my Sencha CMD (currently running v4.0.4.84). I had successfully updated to Sencha CMD v5.0.1.231, however, while trying to init phonegap

sencha phonegap init com.example.www my-app my-app

I get the following errors in my log:

Sencha Cmd v5.0.1.231 [INF] Creating App [ERR] The following error occurred while executing this line: /bin/Sencha/Cmd/5.0.1.231/extensions/cmd-packager/cmd-packager.plugin.xml:131: org.mozilla.javascript.EvaluatorException: Function importClass must be called with a class; had "[JavaPackage java.nio.charset.StandardCharsets]" instead. (anonymous#3)

The same happens with beta v5.0.2.250.

I checked my java version and it is the latest (Java 7 Update 67)

Tha Leang
  • 3,070
  • 1
  • 16
  • 14

5 Answers5

1

After much tinkering, I have managed to get a clean build with no errors.

Here are my steps:

  1. remove phonegap or cordova: sencha-4.0.4.84 cordova remove
  2. Upgrade to new sencha cmd: sencha upgrade
  3. Update app: sencha app upgrade
  4. Add your build settings to your app.json

```

"builds": {
"web": {
    "default": true
},
"native": {
    "packager": "cordova",
    "cordova": {
        "config": {
            // Uncomment the line below and add the platforms you wish to build for
            //"platforms": "ios android",
            "id": "com.company.myapp",
            "name": "BaseCordova231"
        }
    }
}

}

  1. Build your mobile app: sencha app build native

With that, it compiled without any errors, and the app runs in the simulator. Only problem is nothing is showing up.... I guess sencha CMD needs to catch up with my current phonegap v3.5.0-0.21.14.

I think the key problem I had was that I didn't remove cordova/phonegap when Sencha CMD was in v4.0.4.84.

Well, I will take a break from Sencha CMD 5, and use the reliable v4.0.4.84 for now.

Tha Leang
  • 3,070
  • 1
  • 16
  • 14
1

I know that you had a sufficient version, so this is not a solution for you. My app made the same JAVA errors and the solution for me was to upgrade the JDK. I had 1.6.0 which I upgraded to 1.8 and now it's working. Maybe his can help someone.

Lippai Zoltan
  • 188
  • 2
  • 10
1

You need most recent JDK, NOT the JRE as per the Sencha documentation.

horcle_buzz
  • 2,101
  • 3
  • 30
  • 59
0

I am having the same issue with 5.0.1.231, I don't have a fix or explanation for the error in that version but since multiple versions of Sencha CMD can live side-by-side I put the path to the last version of Sencha CMD I had installed infront of my "sencha" command and was able to continue working.

~/bin/Sencha/Cmd/5.0.0.160/sencha phonegap init com.example.www my-app my-app
jcaruso
  • 950
  • 11
  • 19
0

After some tinkering with my project I was able to get Sencha Cmd to work. I ended up making 2 changes:

1) Fixed syntax errors in my javascript files:

C1000: Rhino Parse Warning (Trailing comma is not legal in an ECMA-262 object initializer =>     })

2) Deleted the Sencha Cmd repo folder located at: /Users//bin/Sencha/Cmd/repo Sencha Cmd will rebuild this if it is missing.

I'm not sure which one of those changes actually corrected my issue, but those are the only 2 things I did in between it working and not working. And when I say "it" I mean specifically the sencha app build native command

jcaruso
  • 950
  • 11
  • 19