您的位置:首页 > 产品设计 > UI/UE

Ionic Cordova IOS build fails after adding media plugin

2016-04-06 18:39 423 查看
我使用ionic Framework 和 Cordova开发一个移动端的app,我想添加一个Cordova plugin 但是不能编译报错我试着创建一个tab的app,然后添加插件 (media plugin),这个项目因为添加这个插件不能正常的编译
npm install -g cordova ionic gulp

ionic start ionicTest tabs

ionic platform add ios

cordova plugin add org.apache.cordova.media

ionic build ios
然后我删除这个插件,项目可以正常的进行编译
cordova plugin rm org.apache.cordova.media

ionic build ios
下面是编译显示的错误信息
The following build commands failed:

CompileC build/ionicTest.build/Debug-iphonesimulator/ionicTest.build/Objects-normal/i386/CDVFile.o ionicTest/Plugins/org.apache.cordova.file/CDVFile.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler

CompileC build/ionicTest.build/Debug-iphonesimulator/ionicTest.build/Objects-normal/i386/CDVLocalFilesystem.o ionicTest/Plugins/org.apache.cordova.file/CDVLocalFilesystem.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler

CompileC build/ionicTest.build/Debug-iphonesimulator/ionicTest.build/Objects-normal/i386/CDVSound.o ionicTest/Plugins/org.apache.cordova.media/CDVSound.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler

CompileC build/ionicTest.build/Debug-iphonesimulator/ionicTest.build/Objects-normal/i386/CDVAssetLibraryFilesystem.o ionicTest/Plugins/org.apache.cordova.file/CDVAssetLibraryFilesystem.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler

(4 failures)

Error: /Users/steven/web/ionicTest/platforms/ios/cordova/build: Command failed with exit code 65
查找问题解决办法When you add a plugin, you have to remove and add the platform to make it compile (it's a bug). Try the following:cordova plugin add org.apache.cordova.media
ionic platform remove ios
ionic platform add iosAlso make sure you're standing in the app directory (ionicTest) when you issue the commands. Check that you have the two folders *platforms* and *plugins* in your app folder (on the same level as *www*). If not, create them
before installing the plugin. If they are missing, plugin installation will fail, possibly without error message.项目可以正常的编译,但是在ios虚拟机上测试,照相机没有正常的调用

                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: