添加媒体插件后,Ionic Cordova IOS构建失败 [英] Ionic Cordova IOS build fails after adding media plugin
问题描述
我正在使用Ionic Framework和Cordova开发移动应用程序,我试图添加在Cordova媒体插件,它不会为我构建。
I am developing a mobile app using Ionic Framework and Cordova, I tried to add in the Cordova media plugin and it would not build for me.
我甚至尝试创建一个新的starter tab项目,然后添加媒体插件如图所示。
I even tried to create a fresh starter tabs project, and then add the media plugin as shown. The project does not compile due to adding the 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
然后我删除媒体插件,没有问题项目编译完美
then I remove the media plugin and no problems the project compiles perfectly
cordova plugin rm org.apache.cordova.media
ionic build ios
这是我收到的错误消息,我使用Cordova版本4.1.2
Here is the error message I am getting, I am using Cordova version 4.1.2
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插件添加org.apache.cordova.media
- 离子平台remove ios
- 离子平台添加ios
同时确保您位于应用程序目录(ionicTest)。检查您的应用程式资料夹中是否有两个资料夹 和插件(与 www 相同)。如果没有,请在安装插件之前创建它们。如果缺少,插件安装将失败,可能没有错误消息。
Also 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.
这篇关于添加媒体插件后,Ionic Cordova IOS构建失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!