2012-12-09 72 views
3

使用此命令構建我的sencha touch 2應用程序以進行生產時出現問題:「sencha app build production」。我看到以下問題:使用Google Maps API的應用程序的構建錯誤

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:' 

我看到只有當我使用外部JS(谷歌幾何)文件中app.json文件:

"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> 

回答

2

From Sencha Touch documentation

要使用這個組件,您必須包括來自谷歌的附加JavaScript文件:

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

所以,我想你可以嘗試以這種方式加載API,實際上它們是如何在框架附帶的地圖示例中執行的。

此外,如果谷歌是不確定你的應用程序啓動的時候,我想你可以加載通用API異步:

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

希望這有助於

+0

這種方式加載,構建成功,但是當運行我的應用程序時,得到以下錯誤:未捕獲ReferenceError:谷歌未定義 - index.html –

+0

您可以添加您的index.html到您的文章 –

+0

當然,添加到文章 –

相關問題