2013-12-13 34 views
2

我成功添加並使用Cordova插件構建Sencha Touch應用程序。但是,當我決定稍後添加插件並再次構建時,構建失敗。 是否僅在運行sencha app build native之前添加插件還是存在其他問題。我得到在控制檯下面使用sencha原生版本後添加Cordova插件

[INF] [shellscript] ** BUILD FAILED ** 
[INF] [shellscript] 
[INF] [shellscript] 
[INF] [shellscript] The following build commands failed: 
[INF] [shellscript]  CompileC build/swigmunk.build/Debug-iphonesimulator/swigmunk.build/Objects-normal/i386/CDVCamera.o swigmunk/Plugins/org.apache.cordova.camera/CDVCamera.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler 
[INF] [shellscript]  CompileC build/swigmunk.build/Debug-iphonesimulator/swigmunk.build/Objects-normal/i386/CDVJpegHeaderWriter.o swigmunk/Plugins/org.apache.cordova.camera/CDVJpegHeaderWriter.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler 
[INF] [shellscript] (2 failures) 
[INF] [shellscript] ] 
[ERR] The following error occurred while executing this line: 
/Users/georgy/Developer/swigmunk/public/swigmunk/.sencha/app/build-impl.xml:422: The following error occurred while executing this line: 
/Users/georgy/Developer/swigmunk/public/swigmunk/.sencha/app/cordova-impl.xml:118: The following error occurred while executing this line: 
jar:file:/Users/georgy/bin/Sencha/Cmd/4.0.1.45/sencha.jar!/com/sencha/ant/antlib.xml:608: shellscript returned: 1 
+0

你可能會得到更多的信息,如果你從終端只執行失敗的命令,即'CompileC建立/ swigmunk.build /調試-iphonesimulator/swigmunk.build /對象-normal/i386/CDVCamera.o swigmunk/Plugins/org.apache.cordova.camera/CDVCamera.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler' –

+0

你能解決這個問題嗎?問題?我面臨同樣的問題,似乎沒有解決方案。 – Sourabh86

+0

同樣在這裏,這個問題的任何解決方法? – lascort

回答

1

如果您使用的插件科爾多瓦不管怎樣,它似乎並沒有工作,你爲什麼不跳過煎茶的本地構建和做這一切與科爾多瓦的方式嗎?將是您的方法的替代方案。要做到這一點,你必須建立你的煎茶的項目是這樣的:

// Good for debugging if sth crashes on devices but not in your Browser 
sencha app build testing 

// or for production 
sencha app build production 

你做了之後,你可以看到在你的項目目錄/測試或/生產的文件夾。您需要將裏面的文件複製到您的Cordova項目中。

爲了與Cordova一起工作,您必須創建一個Cordova項目,如docs中所述。如果你這樣做,你可以將構建煎茶項目只是複製到科爾多瓦項目的www文件夾,然後執行:

cordova prepare [your platform] 

此命令將WWW文件到您的本地項目,你可以用Eclipse執行它Android和xCode for iOS。如果您已經添加了一個插件,你需要運行:

cordova prepare [your platform] 
cordova compile [your platform] 

此命令將複製WWW的東西,還建立它來自你的插件本機代碼。

希望有幫助!

1

好吧,我只是經歷了同樣的問題,我通過刪除所有平臺(在我的情況下只是iOS)並在安裝新插件後再次添加它們來解決它。

cordova platform rm ios 
cordova platform add ios 

應該這樣做

+0

確認爲我工作。我的環境被另一個開發人員分解了,所以這可能是由於本地沒有調用'cordova platform add ios'造成的。 –