1. #1
    Sencha User
    Join Date
    Jun 2013
    Posts
    6
    Vote Rating
    2
    patrick@cloudmatters.co is on a distinguished road

      2  

    Default Sencha Cordova Integration Emulating & Packaging App Fails

    Sencha Cordova Integration Emulating & Packaging App Fails


    REQUIRED INFORMATION
    Sencha Cmd version(s) tested:
    • Sencha Cmd v4.0.0.194
    Operating System:
    • Mac OS X 10.8.5
    Framework used:
    • Sencha Touch 2.3.0-b2
    Description:
    • Following the steps from the 2.3.0 documentation found here : http://sc13-live.sencha.com/touch-docs/#!/guide/cordova
    • generate an initial application, then init cordova ( cordova installed using npm)
    • both sencha app build -run native and sencha app build native fail at the same place
    Diagnostic Output:The output from sencha diag show:
    Code:
    [INF] 
    [INF] -after-init-local:
    [INF] 
    [INF] init-local:
    [INF] 
    [INF] find-cmd-in-path:
    [INF] 
    [INF] find-cmd-in-environment:
    [INF] 
    [INF] find-cmd-in-shell:
    [INF] 
    [INF] init-cmd:
    [INF]      [echo] Using Sencha Cmd from /Users/patt0/tools_root/Sencha/Sencha/Cmd/4.0.0.194 for /Users/patt0/Desktop/dev_root/fms/build.xml
    [INF] 
    [INF] -before-init:
    [INF] 
    [INF] -init:
    [INF] 
    [INF] -after-init:
    [INF] 
    [INF] -before-init-defaults:
    [INF] 
    [INF] -init-defaults:
    [INF] 
    [INF] -after-init-defaults:
    [INF] 
    [INF] -init-compiler:
    [INF] 
    [INF] init:
    [INF] 
    [INF] -before-cordova-init:
    [INF] 
    [INF] -cordova-init:
    [INF] 
    [INF] -after-cordova-init:
    [INF] 
    [INF] cordova-init:
    [INF] 
    [INF] cordova-copy-build:
    [INF] 
    [INF] -before-cordova-copy-build:
    [INF] 
    [INF] -cordova-copy-build:
    [INF] 
    [INF] -after-cordova-copy-build:
    [INF] 
    [INF] -before-cordova-platform-add:
    [INF] 
    [INF] -cordova-platform-add:
    [ERR] The following error occurred while executing this line:
    /Users/patt0/Desktop/dev_root/fms/.sencha/app/build-impl.xml:414: The following error occurred while executing this line:
    /Users/patt0/Desktop/dev_root/fms/.sencha/app/cordova-impl.xml:141: javax.script.ScriptException: sun.org.mozilla.javascript.internal.EvaluatorException: Java class "[Ljava.lang.String;" has no public instance field or method named "forEach". (<Unknown source>#10) in <Unknown source> at line number 10
         at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:551)

    Steps to reproduce the problem:
    Code:
    NGKW-MAC-266:touch-2.3.0 patt0$ sencha generate app fms ~/Desktop/dev_root/fms
    NGKW-MAC-266:touch-2.3.0 patt0$ cd ~/Desktop/dev_root/fms
    NGKW-MAC-266:fms patt0$ sencha cordova init
    changed cordova.local.properties to cordova.platforms=ios android
    Code:
    NGKW-MAC-266:fms patt0$ sencha app build -run native

    The result that was expected:
    • normal execution with each package build
    The result that occurs instead:
    • java exception
    HELPFUL INFORMATION

    Screenshot or Video:
    • None
    Possible fix:
    • not provided (perhaps there is a bug in a generated file or script)

  2. #2
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Posts
    1,365
    Vote Rating
    135
    dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold

      1  

    Default


    Please see http://www.sencha.com/forum/showthre...nknown-command.

    The Cordova integration in Cmd 4 RC is being replaced in Cmd 4 GA to upgrade to the v3 Cordova API.
    Don Griffin
    Ext JS Development Team Lead

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

  3. #3
    Sencha User
    Join Date
    Jun 2013
    Posts
    6
    Vote Rating
    2
    patrick@cloudmatters.co is on a distinguished road

      0  

    Default


    Thanks, the problem I describe is slightly different, in any case lets wait for the GA to drop and we will see.

  4. #4
    Sencha User
    Join Date
    Nov 2011
    Posts
    1
    Vote Rating
    0
    n1k0laj is on a distinguished road

      0  

    Default


    I get the same errors.
    Sencha Cmd version(s) tested: 4.0.0.203
    Operating System: Mac OS 10.8.4
    Framework used: 2.3.0

  5. #5
    Touch Premium Member
    Join Date
    Jun 2010
    Posts
    19
    Vote Rating
    0
    v.stella is on a distinguished road

      0  

    Default Same problem...

    Same problem...


    Quote Originally Posted by n1k0laj View Post
    I get the same errors.
    Sencha Cmd version(s) tested: 4.0.0.203
    Operating System: Mac OS 10.8.4
    Framework used: 2.3.0
    I've the same problem with Sencha Cmd 4.0.0.203, framework ST 2.3.0, on OSX 10.8.5

    [INF] -cordova-platform-add:
    [ERR] The following error occurred while executing this line:
    /Users/xxxx/Documents/Production/xxx/appName/.sencha/app/build-impl.xml:414: The following error occurred while executing this line:
    /Users/xxxx/Documents/Production/xxx/appName/.sencha/app/cordova-impl.xml:141: javax.script.ScriptException: sun.org.mozilla.javascript.internal.EvaluatorException: La classe Java "[Ljava.lang.String;" ne poss?de aucun champ ou aucune m?thode d'instance publique appel? "forEach" (<Unknown source>#10) in <Unknown source> at line number 10

  6. #6
    Sencha - Sencha Touch Dev Team
    Join Date
    Oct 2010
    Posts
    90
    Vote Rating
    21
    RossGerbasi will become famous soon enough RossGerbasi will become famous soon enough

      4  

    Default


    Hey gang,

    Apologies all around for this bug, essentially the problem is Java 1.6 does NOT have forEach support. We had been testing on a mac with 1.7 so everything seemed smooth. Cmd 4.0.1 will fix this bug but wont be out for a little while so there are some ways to fix this now.

    First you can upgrade to Java 1.7 on your system.
    http://www.oracle.com/technetwork/ja...ads/index.html

    Second option is to use PhoneGap instead of Cordova. PhoneGap internally checks for missing platforms whereas in the Cordova Packager we had to do this ourselves, which is where the loop comes in. If you init your app with PhoneGap instead this will not be an issue

    Last option is to use the attached cordova-impl.xml file. You will need to rename this file from cordova-impl.xml.txt to just cordova-impl.xml. You then need to replace the cordova-impl here:
    Code:
    /Users/{username}/bin/Sencha/Cmd/4.0.0.203/extensions/cmd-cordova-packager/templates/App/.sencha/app
    Then if you have an existing app with this problem you will need to replace the cordova-impl.xml here:
    Code:
    {app}/.sencha/app
    Attached Files
    Ross Gerbasi
    Sencha Inc | Senior Software Engineer

  7. #7
    Touch Premium Member
    Join Date
    Jun 2010
    Posts
    19
    Vote Rating
    0
    v.stella is on a distinguished road

      0  

    Default @RossGerbasi

    @RossGerbasi


    Thanks a lot RossGerbasi, it seems to work with your solution.

  8. #8
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,305
    Vote Rating
    106
    ssamayoa is just really nice ssamayoa is just really nice ssamayoa is just really nice ssamayoa is just really nice

      0  

    Default


    Java 1.6 does NOT have forEach support


    What you mean?


    this?

    for (SomeType var : someCollection) { ... }

    If so that existed since 1.5 so problem ins't what you said.

    Regards.
    UI: Sencha Architect 3.x / ExtJS 4 & 5
    Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
    Application Server: Glassfish / WildFly
    Databases: Oracle / DB2 / MySQL / Firebird

    If you like my answer please vote!

  9. #9
    Sencha User
    Join Date
    Jun 2013
    Posts
    6
    Vote Rating
    2
    patrick@cloudmatters.co is on a distinguished road

      0  

    Default


    Yes thank you, the patch worked, I was able to get this working a few days ago, the instructions in the 2.3.0 Cordova guide, make appropriate mention of it.

  10. #10
    Sencha User
    Join Date
    Jan 2013
    Posts
    18
    Vote Rating
    0
    chandu_munna is on a distinguished road

      0  

    Default


    thanks a lot.......