'RestKit/RKSerialization.h' file not found via Cocapods - ios

I've been trying for hours but couldn't find any solution that helped me to solve the issue.
my Podfile looks like:
source 'https://github.com/CocoaPods/Specs.git'
inhibit_all_warnings!
xcodeproj 'MyProject.xcodeproj'
# Uncomment this line to define a global platform for your project
# platform :ios, '6.0'
target 'MyProject' do
pod 'ZBarSDK', '~> 1.3.1'
pod 'RestKit'
end
I have tried different options but none of them are working.
Header Search Paths and Library Search Paths & Framework Search Paths have: $(inherited) as value.
#import <RestKit/RestKit.h> // works fine
#import <RestKit/RKSerialization.h> // I get 'RestKit/RKSerialization.h' file not found
#import <RestKit/RKJSONParserJSONKit.h> // 'RestKit/RKJSONParserJSONKit.h' file not found
UPDATE:
cocapods version - 0.38.0
XCode version - Version 7.0 (7A220)

I've managed to solve it by using the following Podfile and recreated the project from scratch. I think the problem was that the XCode was created with older version and might interfere something.
source 'https://github.com/CocoaPods/Specs.git'
inhibit_all_warnings!
xcodeproj 'MyProject.xcodeproj'
# Uncomment this line to define a global platform for your project
# platform :ios, '6.0'
target 'MyProject' do
pod 'ZBarSDK', '~> 1.3.1'
pod 'RestKit', '0.10.3' //This is the lastest version that has RKJSONParserJSONKit file, next version is not backward compatibility with previous version, you need to update the code
pod 'FileMD5Hash', :podspec => 'FileMD5Hash.podspec.json'
end
and FileMD5Hash.podspec.json content. You will need to create that file on root folder of the Podfile, thanks & +1 to #ryanmaxwell
{
"name": "FileMD5Hash",
"version": "0.0.1",
"license": "Apache",
"summary": "Library for computing MD5 hashes of files with small memory usage.",
"homepage": "http://www.joel.lopes-da-silva.com/2010/09/07/compute-md5-or-sha-hash-of-large-file-efficiently-on-ios-and-mac-os-x/",
"authors": {
"Joel Lopes Da Silva": "joel#lopes-da-silva.com"
},
"source": {
"git": "https://github.com/JoeKun/FileMD5Hash.git",
"commit": "6864c180c010ab4b0514ba5c025091e12ab01199"
},
"prefix_header_file": "Common/FileMD5Hash_Prefix.pch",
"source_files": "Common/*.{h,c}",
"requires_arc": false
}

Related

Using MapboxNavigation iOS with Xcode 10

Is there any possibility to use MapboxNavigation (version 0.21 or 0.22) iOS with Xcode 10. On its Github and CocoaPods site is stated, that it can only be used with Xcode 9, but a few issues on Github mention the (successful) use of Xcode 10 with MapboxNavigation.
However, I tried to install MapboxNavigation via CocoaPods using Xcode 10 and get a bunch of errors:
/Users/Paul_Obernolte/Library/Developer/Xcode/DerivedData/pq-app-v2-gynuaxsohvqddqegrvemywowchkr/Build/Products/Debug-iphonesimulator/MapboxDirections.swift/Swift Compatibility Header/MapboxDirections-Swift.h:171:9: error: 'MapboxDirections/MapboxDirections.h' file not found
#import <MapboxDirections/MapboxDirections.h>
^
<unknown>:0: error: could not build Objective-C module 'MapboxDirections'
Is there any workaround to avoid this errors using Xcode 10?
Edit: Here is my Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
EXPO_CPP_HEADER_DIR = 'ExpoKit'
target 'pq-app-v2' do
pod 'MapboxDirections.swift', '~> 0.23'
pod 'MapboxMobileEvents',
:git => 'https://github.com/mapbox/mapbox-events-ios.git',
:commit => "79d29f1df5a9187481f5c9ac8fa13430d1f04139"
pod 'MapboxNavigation', '~> 0.21.0'
... (more Pods)
end
I need to download MapboxMobileEvents separately because of this issue: https://github.com/mapbox/mapbox-events-ios/pull/85
target 'pq-app-v2' do
use_frameworks!
... (more Pods)
end
change code in pod file if "use_frameworks!" is commented than put it uncommented as above.

How can I replace link_with with target blocks?

I have updated cocoapods today to 1.0.0 version. I got this string when I update the pods:
[!] InvalidPodfilefile: [!] The specification oflink_within the Podfile is now unsupported, please use target blocks instead..
The content of my Pod file is
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target 'QuickStart' do
# Uncomment this line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for QuickStart
source 'https://github.com/CocoaPods/Specs.git'
link_with ['QuickStart']
xcodeproj 'QuickStart'
pod 'ADALiOS', :git => 'https://github.com/AzureAD/azure-activedirectory-library-for-objc.git', :branch=> 'convergence'
pod 'NXOAuth2Client'
source 'https://github.com/CocoaPods/Specs.git'
link_with ['QuickStart']
xcodeproj 'QuickStart'
pod 'ADALiOS'
end

Include static frameworks and libs on cocoapods

After spending hours, I definitely need your help.
I want to create a pod including Spotify SDK (here, it's a .framework) and Deezer SDK (here, it's a *.a lib) in order to do some work with.
Both SDK are written in Objective-C, and I want to write my pod in Swift 2 (iOS 8). Also, projects that will include this pod are in Swift 2 (iOS 8).
After the creation of the pod project with pod create lib I started by trying to add Spotify.framework directly in the pod project, but can't compile...
So, I tried to include the Spotify.framework like a pod by writing a podspec, here is spotify.podspec.json :
{
"name": "FakeSpotify",
"version": "1.1",
"summary": "Spotify iOS SDK",
"homepage": "https://developer.spotify.com/technologies/spotify-ios-sdk/",
"license": "MIT",
"authors": {
"jjt": "jeanjaques#thierry.com"
},
"source": {
"git": "https://github.com/spotify/ios-sdk.git",
"tag": "beta-13"
},
"platforms": {
"ios": "8.0"
},
"requires_arc": true,
"preserve_paths": "Spotify.framework",
"public_header_files": "Spotify.framework/Versions/A/Headers/*.h",
"vendored_frameworks": "Spotify.framework",
"xcconfig": {
"OTHER_LDFLAGS": "-ObjC"
}
}
And I Also added a line on the Podfile :
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
target 'SpoTest_Example', :exclusive => true do
pod 'SpoTest', :path => '../'
pod 'FakeSpotify', :podspec => './spotify.podspec.json'
end
target 'SpoTest_Tests', :exclusive => true do
pod 'SpoTest', :path => '../'
end
Now, after a pod install, a folder "FakeSpotify" is created with the the Spotify.framework in it. This part is ok, but it's not enough : I can't use it...
I can't import Spotify neither in the example project, nor in the development pods files (both in Swift).
I tried to add #import <Spotify/Spotify.framework in the umbrella file (SpoTest-umbrella.h), but there were an error : Include of non-modular header inside framework module 'SpoTest'.
After hitting myself and some search, I tried to edit my podfile by adding this post script :
post_install do |installer|
installer.pods_project.build_configuration_list.build_configurations.each do |configuration|
configuration.build_settings['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = 'YES'
end
end
Nothing better, same error. Ok ok, what can I do ? Hmmm, I tried to remove the previously added import in umbrella file and I edited my pod podspec (SpoTest.podspec). I cried "ohhh I'm really bad, we need to also tell that we have a dependency in this podspec, even for development test...".
So I added this beautiful line : s.dependency 'FakeSpotify'
I was so happy, ... and so sad : new error from pod install command now :
[!] The 'Pods-SpoTest_Example' target has transitive dependencies that include static binaries: (/Users/jjt/Documents/dev/ios/LIBS/SpoTest/Example/Pods/FakeSpotify/Spotify.framework)
Ouch, so close ! Ok, let's try something to deal with it. I edited my Podfile by adding a pre install script :
pre_install do |installer|
# workaround for https://github.com/CocoaPods/CocoaPods/issues/3289
def installer.verify_no_static_framework_transitive_dependencies; end
end
With this, the command line is ok, and the installation is done. But I still can't use it. And there is still an error if I import the framework in umbrella.
Do you have any more ideas ? I currently don't have more :)
Or maybe there is a better way without cocoapods ? My goal is to create a something with these two SDK, and to include it easily on others reals projects.
Thanks.

Error ITMS-90206 Invalid bundle contains disallowed file 'Frameworks'

I have a problem uploading my application into the Store via Xcode, this one in particular.
I saw a lot of post about this error, but all are talking about Extension App, that I do not use.
I'm using a Custom framework and Cocoapods.
You can see here my tree :
XXX is my project app name
SharedXXX is my custom framework
Pods is the project created by cocoa pods
Here is my cocoa podFile :
use_frameworks!
link_with 'XXX', 'SharedXXX'
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.1'
workspace 'XXX'
xcodeproj 'XXX/XXX.xcodeproj'
xcodeproj 'Shared/SharedXXX.xcodeproj'
def default_pods
pod 'Reveal-iOS-SDK', :configurations => ['Debug']
pod "SnapKit", '~> 0.17.0'
pod "DKChainableAnimationKit", '~> 1.6.0'
pod "AsyncSwift"
end
def shared_pods
pod "Alamofire", '~> 3.0'
pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git'
pod 'ReachabilitySwift', :git => 'https://github.com/ashleymills/Reachability.swift'
end
target :XXX do
xcodeproj 'XXX/XXX.xcodeproj'
default_pods
shared_pods
end
target :XXXDev do
xcodeproj 'XXX/XXX.xcodeproj'
default_pods
shared_pods
end
target :SharedXXX do
xcodeproj 'Shared/SharedXXXX.xcodeproj'
shared_pods
end
Build settings for custom framework (SharedXXX) :
I set the Embedded property to Yes
General Settings for custom framework (SharedXXX) :
The framework provided by Cocoapods is linked.
And to finish,
The General Settings to the main project (App Project : called XXX on the tree)
:
Any idea ?
I solved the problem
Firstly, set into Build Settings
For main project (here XXX) : Embedded Content Contains Swift Code to
YES
Custom Framework (SharedXXX) : Embedded Content Contains Swift Code to NO
Custom Framework (SharedXXX) : Runpath Search Path = #executable_path/../../Frameworks
This helped me solving that issue
I faced the same problem while trying to upload from Xcode 9.3
This happened because I added 'use_frameworks' in my OneSignal
NotificationServiceExtension
The value Always Embed Swift Standard Libraries found in Build Settings should be set to Yes only for you main Projects and not for your custom frameworks or extensions.

Why does Cocoapods adds HockeyMac-SDK to my iOS Target?

Given that Podfile
workspace 'Foo'
target :Foo_Mac do
xcodeproj 'Mac/Foo_Mac'
platform :osx
pod 'HockeySDK-Mac'
end
target :Foo_iOS do
xcodeproj 'Foo_iOS'
platform :ios, '7.0'
pod 'Parse-iOS-SDK'
end
How comes both my Pods-Foo_iOS.xcconfig & Pods-Foo_Mac.xcconfig contains
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/HockeySDK-Mac" "${PODS_ROOT}/Headers/Parse-iOS-SDK"
Shouldn't it just have the ones from the Podfile?
You’re absolutely right, that’s a bug. Please file a ticket.

Resources