当前位置: 首页 > 工具软件 > Media Plugin > 使用案例 >

Ionic Cordova IOS build fails after adding media plugin

何博涛
2023-12-01

我使用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:

  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.

项目可以正常的编译,但是在ios虚拟机上测试,照相机没有正常的调用




 类似资料:

相关阅读

相关文章

相关问答