2013-12-13 33 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'造成的。 –