Plugins 使用sencha在本机构建后添加Cordova插件

Plugins 使用sencha在本机构建后添加Cordova插件,plugins,cordova,build,sencha-touch,Plugins,Cordova,Build,Sencha Touch,我成功地添加并构建了一个带有Cordova插件的Sencha Touch应用程序。然而,当我决定稍后添加插件并再次构建时,构建失败。 您是在运行sencha app build native之前才添加插件,还是存在其他问题。我在控制台中得到以下信息 [INF] [shellscript] ** BUILD FAILED ** [INF] [shellscript] [INF] [shellscript] [INF] [shellscript] The following build comm

我成功地添加并构建了一个带有Cordova插件的Sencha Touch应用程序。然而,当我决定稍后添加插件并再次构建时,构建失败。 您是在运行sencha app build native之前才添加插件,还是存在其他问题。我在控制台中得到以下信息

[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

如果您使用的是Cordova插件,但它似乎不起作用,那么您为什么不跳过sencha的本机构建,一直使用Cordova呢?将是您的方法的替代方案。为此,您必须按照以下方式构建sencha项目:

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

// or for production
sencha app build production
完成后,您可以在项目目录中看到/testing或/production文件夹。您需要将其中的文件复制到Cordova项目中

要使用Cordova实现这一点,您必须创建一个Cordova项目,如中所述。如果您已经这样做了,您可以将build Sencha项目复制到Cordova项目的www文件夹中,然后执行:

cordova prepare [your platform]
此命令将www文件复制到本机项目中,您可以使用Eclipse for Android和xCode for iOS执行它。如果已添加插件,则需要运行:

cordova prepare [your platform]
cordova compile [your platform]
此命令将复制www内容,并构建来自插件的本机代码


希望有帮助

好的,我也遇到了同样的问题,我通过删除所有平台(我的例子中只有iOS)并在安装新插件后再次添加它们来解决这个问题

cordova platform rm ios
cordova platform add ios

这应该可以做到

如果只执行终端的失败命令,您可能会获得更多信息,也就是说,
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
你能解决这个问题吗?我面临着同样的问题,似乎没有解决办法。同样的,这个问题有解决办法吗?我之所以出现这个错误,是因为另一个错误,即:我无法让“cordova平台添加android”工作。但是在通过更新check_reqs.js来修复这个问题之后,我就可以添加android了,然后上面的命令也起了作用。确认对我有效。我的环境是由另一个开发人员启动的,因此这可能是因为没有在本地调用
cordova platform add ios