我使用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:
项目可以正常的编译,但是在ios虚拟机上测试,照相机没有正常的调用