Is there a way to hide warnings within cocoapods in the AppCode build log? I like seeing warnings in my code but the massive number of warnings that result from building my included cocoapods make it hard to see my warnings. It would be nice if I could configure AppCode to hide warnings that come from building source in the Pods directory.
Try this:
inhibit_all_warnings!
My Podfile starts with:
platform :ios, '8.0'
use_frameworks!
# ignore all warnings from all pods
inhibit_all_warnings!
source 'https://github.com/CocoaPods/Specs.git'
Related
I have a project that has the Podfile with the following configuration
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
target 'CDA' do
pod 'RestKit', '~> 0.27.0'
pod 'ZBarSDK', '~> 1.3.1'
end
I use the Pod install command and I get the following result
But when I try to build the project on Xcode, I received the following error:
For some reason, the compiler was not able to find the libraries from cocoapod.
How can I fix this error?
I found a way to fix the problem.
I follow the guide on this site
https://guides.cocoapods.org/using/troubleshooting.html
What fix the problem for me is the step number 5.
I add the Libraries direct to build now and at the moment it works now for me, all builds are working now.
Here's my podfile:
source 'https://github.com/CocoaPods/Specs.git'
# Uncomment the next line to define a global platform for your project
target 'raceQs' do
platform :ios, '11.1'
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for raceQs
pod 'AppCenter'
pod 'Alamofire'
end
target 'raceQs WatchKit Extension' do
platform :watchos, '4.1'
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for raceQs WatchKit Extension
pod 'Alamofire'
end
I'm opening my project's xcworkspace and getting a compile error:
Developer/Xcode/DerivedData/raceQs-cwycjawfwoosfubowtoymeizvfln/Build/Products/Debug-iphoneos/raceQs.app/Frameworks/Alamofire.framework'
/Users/mac/Library/Developer/Xcode/DerivedData/raceQs-cwycjawfwoosfubowtoymeizvfln/Build/Products/Debug-iphoneos/raceQs.app/Frameworks/Alamofire.framework: bundle format unrecognized, invalid, or unsuitable
In my Xcode project Navigator, the Frameworks/ Pods_raceQs_WatchKit_Extension is displayed in red.
Any assistance would be greatly appreciated.
I am trying to using Cocoapods 0.39.0 for the dependencies of my project. I have followed the steps, but I end up with a red Pods.framework in my project. If I look at the path where XCode 7.2.1 says it should be, it doesn't exist:
/Users/ajmas/Library/Developer/Xcode/DerivedData/myproject-cskuurnzjrcpcxfoyaceaeepshgt/Build/Products/Debug/Pods.framework
I have looked around at other entries in Stackoverflow, but I am not find anything indicating how the framework should be generated.
The contents of my Podfile are:
source 'https://github.com/CocoaPods/Specs.git'
target 'myproject' do
platform :osx, '10.11'
use_frameworks!
pod 'Alamofire', '~> 3.0'
end
Any ideas?
Edit, also tried with Cocoapods 1.0.0.beta and no change, even after updating the Podfile to confirm to 'target' being a requirement now.
Build your project with "Generic iOS Device" selected.
If this happens it's most likely because you are using <your_project>.xcproject. When you run pod install CocoaPods creates a <your_project.xcworkspace file that you need to use to have dependencies installed via CocoaPods be available when compiling.
I am using realm.io as storage for some data. I want to share this data with my Today extension. I am using CocoaPods and I am wondering how I can share that Framework with both targets. My podfile looks like this:
platform :ios, '8.0'
use_frameworks!
pod 'RealmSwift'
pod 'MBProgressHUD'
pod 'Alamofire'
I tried with this and it worked when building to device, but not when building to the iOS simulator. It returned the error 'ld: framework not found Pods':
platform :ios, '8.0'
use_frameworks!
def shared_pods
pod 'RealmSwift'
pod 'Alamofire'
end
target 'App' do
shared_pods
pod 'MBProgressHUD'
end
target 'AppToday' do
shared_pods
end
What am I doing wrong?
Appreciate any help.
Brgds
Your Podfile looks correct and would work on a clean installation. But you found a bug in the user project integration in CocoaPods when migrating between different setups.
Background info
If you don't explicitly specify a target in the Podfile, then CocoaPods will integrate with the first target in your project. This was your app target, which worked correct as long as it was the only one.
But now you're referencing explicitly to the targets. CocoaPods will create separate so called aggregate targets. Those are in the Pods.xcodeproj and named Pods-App and Pods-AppToday. These are static framework targets (from 0.39.beta.5), which are weak linked to your targets to help Xcode finding your dependencies in the Pods project. Because CocoaPods doesn't know anything about the previous Podfile when you run pod install (and it doesn't retain this information in the Podfile.lock), it doesn't remove the old aggregate target, which was named just Pods and it's product reference in your app target.
Resolving the issue
Select your project file in Xcode in the file navigator
Select your app target in the left pane from the targets list
Go to the General tab
Remove Pods.framework from the Linked Frameworks and Libraries pane
Expected state before
How it should look like
platform :ios, '8.0'
use_frameworks!
pod 'RealmSwift'
pod 'MBProgressHUD'
pod 'Alamofire'
Add this line
link_with 'App', 'AppToday'
Using iOS-8.3, Xcode-6.3.1 and MacOS-10.10.3 - The CocoaPods (v0.37.1) installation of the RealmSwift (v0.92.3) described here and here basically works, except the WatchKit Extension does not find any Realm keywords.
My Podfile looks as follows:
xcodeproj 'MyApp.xcodeproj'
workspace 'MyApp.xcworkspace'
platform :ios, '8.3'
source 'https://github.com/artsy/Specs.git'
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
def shared_pods
pod 'RealmSwift', '>= 0.92.3'
end
target 'MyApp' do
shared_pods
end
target 'MyAppTests' do
shared_pods
end
target 'MyApp WatchKit Extension' do
shared_pods
end
link_with 'MyApp', 'MyApp WatchKit Extension'
All my Realm-keywords in the WatchKit Extension do not work as can be seen in the following error messages (...having commented out any import RealmSwift statements) (see pictures below)
Any idea strongly appreciated of what could still be wrong ???
Any idea on how the target-settings must be. Hint: The NameEntry Realm-Object is used in both targets (i.e. MyApp and also MyApp WatchKit Extension). This seems to add complexity to the CocoaPods usage. Any idea if the double-usage (i.e. in both targets) need a special cocoapods setting ?? What about "import RealmSwift" - is this necessary or not ??
The Podfile above is actually the right one !!
However, it is important that you still "import RealmSwift" in your Realm-Object definition(s) using CocoaPods as can be seen in the corrected example below. This will make your error messages of the WatchKit Extension not recognizing any realm-object go away !
Also, if you intend to use your Realm-Object in two targets (i.e. "MyApp" and "MyApp WatchKit Extension"), make sure you select both the corresponding targets in the target selection pane of your RealmObject.swift file (see image below):