问题
I have created an ionic Project. I build the app and its working perfectly using Ionic CIL. Now using cocoapods, I created a pod file and loadded the required pods and did pod install.
Now when I try to run ionic run/build ios, I get this error: ld: library not found for -lPods clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error code 65 for command: xcodebuild with args: -xcconfig
Command failed with exit code 2
Please help me ...
回答1:
The issue that causes the build to fail is that once you start using CocoaPods you have to build the project .xcworkspace not the .xcodeproj.
I created a plugin that makes supporting CocoaPods simple by just adding a in your config.xml or plugin.xml. The plugin handles the creation of the Podfile and fixes the build scripts used by the ios platform.
Check it out https://github.com/blakgeek/cordova-plugin-cocoapod-support. to support fo swift also, Update to version 1.2.5 of the plugin and add the following to the ios platform section of your config.xml
<preference name="pods_ios_min_version" value="8.0"/>
<preference name="pods_use_frameworks" value="true"/>
回答2:
You have to remove your iOS platform and then add the 5.0.0 version like this:
ionic cordova platform remove ios
ionic cordova platform add ios@5.0.0
Hope that helps.
来源:https://stackoverflow.com/questions/38584906/using-cocoapods-stops-ios-build-using-ionic-project