Ionic Cordova IOS build fails after adding media plugin

ぃ、小莉子 提交于 2020-01-01 06:24:50

问题


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.

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

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

回答1:


When you add a plugin, you have to remove and add the platform to make it compile (it's a bug). Try the following:

  1. cordova plugin add org.apache.cordova.media
  2. ionic platform remove ios
  3. ionic platform add ios

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.



来源:https://stackoverflow.com/questions/27087018/ionic-cordova-ios-build-fails-after-adding-media-plugin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!