3

我在构建我的 sencha touch 2 应用程序以进行生产时遇到问题,使用以下命令:“sencha app build production”。我看到以下问题:

C:\xampp\htdocs\eiamobile\eiamobile\i>sencha app build production
[INFO] Deploying your application to C:\xampp\htdocs\eiamobile\eiamobile\i\build\production
[INFO] Copied sdk/sencha-touch.js
[INFO] Copied app.js
[ERROR] UNKNOWN, unknown error 'C:\xampp\htdocs\eiamobile\eiamobile\i\build\production\http:'

如果我在 app.json 文件中使用外部 JS(谷歌几何)文件,我只会看到:

  "js": [
    {
        "path": "sdk/sencha-touch.js"
    },
    {
        "path": "app.js",
        "bundle": true,  /* Indicates that all class dependencies are concatenated into this file when build */
        "update": "delta"
    },
    {
        "path": "http://maps.google.com/maps/api/js?sensor=false&v=3&libraries=geometry",
        "bundle": true,  /* Indicates that all class dependencies are concatenated into this file when build */
        "update": "delta"
    }

]

任何帮助将不胜感激

编辑:

添加我的 index.html 文件

 <html manifest="" lang="en-US">
 <head>
 <meta charset="UTF-8">
 <title>eia-sencha</title>
 <style type="text/css">
     /**
     * Example of an initial loading indicator.
     * It is recommended to keep this as minimal as possible to provide instant feedback
     * while other resources are still being loaded for the first time
     */
    html, body {
        height: 100%;
        background-color: #1985D0
    }

    #appLoadingIndicator {
        position: absolute;
        top: 50%;
        margin-top: -15px;
        text-align: center;
        width: 100%;
        height: 30px;
        -webkit-animation-name: appLoadingIndicator;
        -webkit-animation-duration: 0.5s;
        -webkit-animation-iteration-count: infinite;
        -webkit-animation-direction: linear;
    }

    #appLoadingIndicator > * {
        background-color: #FFFFFF;
        display: inline-block;
        height: 30px;
        -webkit-border-radius: 15px;
        margin: 0 5px;
        width: 30px;
        opacity: 0.8;
    }

    @-webkit-keyframes appLoadingIndicator{
        0% {
            opacity: 0.8
        }
        50% {
            opacity: 0
        }
        100% {
            opacity: 0.8
        }
    }
 </style>
 <!-- The line below must be kept intact for Sencha Command to build your application -->
<script id="microloader" type="text/javascript" src="sdk/microloader/development.js"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&v=3&libraries=geometry"></script>

 </head>
 <body>
   <div id="appLoadingIndicator">
    <div></div>
    <div></div>
    <div></div>
   </div>
 </body>
 </html>
4

2 回答 2

2

尝试添加"remote": trueapp.json

http://mitchellsimoens.com/2012/07/sencha-touch-2/going-remote-with-sencha-command/

于 2012-12-09T20:33:19.520 回答
2

来自 Sencha Touch 文档

要使用此组件,您必须包含来自 Google 的附加 JavaScript 文件:

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>

所以,我想你可以尝试以这种方式加载 API,这实际上是他们在框架附带的地图示例中执行此操作的方式。

此外,如果您的应用启动时未定义 google,我想您可以异步加载 GM API:

http://www.senchafiddle.com/#MhAME

希望这可以帮助

于 2012-12-09T21:00:16.447 回答