ExtJS 6 - 无法使用命令“sencha app build native”创建本机应用程序。

时间:2015-08-25 13:15:52

标签: extjs phonegap-build sencha-cmd extjs6 extjs6-modern

我正在使用sencha cmd 6并尝试在以下情况下构建本机应用程序 - https://docs.sencha.com/cmd/6.x/cordova_phonegap.html

我使用以下命令生成了Ext 6+通用应用程序:

sencha -sdk /path/to/Framework generate app MyApp /path/to/MyApp

然后我在app.json中添加了以下代码 -

"builds": {
         "classic": { 
            "toolkit": "classic",
             "theme": "theme-triton",
             "sass": { 
                // "save": "classic/sass/save.json" 
          } 
    },         
"native": { 
            "toolkit": "modern",
             "theme": "theme-cupertino",
             "packager": "phonegap",
             "phonegap": {
                 "config": {
                    "platforms": "ios android",
                    "id": "com.mydomain.MyApp"
                 }
             }
         }
 }

但是在运行sencha app build android之后,我得到了以下异常 -

 BUILD FAILED
 java.lang.NullPointerException
   at org.a
 pache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)

另外根据从sencha doc开发PhoneGap应用程序的建议,我已经使用以下代码修改了app.json -

"builds": {
         "native": {
            "packager": "phonegap",
            "phonegap" : {
                "config": {
                    "platforms": "ios android",
                    "id": "com.mydomain.MyApp"
                }
            }
        }
    }

但在此之后,我的控制台上会出现以下异常 -

Failed to resolve dependency Ext.app.Application for file MyApp.Application

BUILD FAILED
com.sencha.exceptions.ExNotFound: Unknown definition for dependency : Ext.app.Application

2 个答案:

答案 0 :(得分:1)

我知道这是一个迟到的答案,但它可能会帮助其他人登陆此页面。

要解决依赖关系,我们需要在构建配置文件中包含工具包和主题:

"native": {
            "toolkit": "modern",
            "theme": "theme-cupertino",
            "packager": "cordova",
            "cordova": {
                "config": {
                    "platforms": "android",
                    "id": "com.mydomain.NewApp"
                }
            }
        }

在上下文中,构建配置文件应如下所示:

resolving Ext.Application Dependency - Click to see the build profile

答案 1 :(得分:-1)