0

I have an issue with CocoaPods compatibility. And I have stuck for a week. I need my app to work on iOS8+ and extension targets to work with iOS9+.
+ I have removed and re-added all the pod files, workspaces, etc - didn't work. Nothing of that!
+ I have linked and unlinked targets - didn't work.
+ I have tried switching flags in pods targets & project targets - didn't work.
+ I have tried changing header search paths - didn't work.

Current state

Here is how my Pods target Manifest.lock

diff "${SRCROOT}/Podfile.lock" "${SRCROOT}/Pods/Manifest.lock" > /dev/null
if [[ $? != 0 ]] ; then
cat << EOM
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
EOM
exit 1
fi

Here is my Pods file:

###############################################################
#################################### Intro
###############################################################
source 'https://github.com/CocoaPods/Specs.git'
#use_frameworks!
#workspace 'MainProject.xcworkspace'
inhibit_all_warnings!
link_with 'MainProject', 'ExtensionProject'
platform :ios, '8.0'

###############################################################
#################################### Shared definitions
###############################################################
def sharedData
    pod 'BlocksKit/Core'
    pod 'BlocksKit/DynamicDelegate'
end

###############################################################
#################################### Pods
###############################################################
target 'ExtensionProject' do
    sharedData
end
target 'MainProject' do
    sharedData
    pod 'BlocksKit/MessageUI'
    pod 'BlocksKit/UIKit'
end


###############################################################
#################################### Pre & Post Installs
###############################################################
post_install do |installer_representation|
    installer_representation.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            # All the targets should have this parameter set to NO.
            puts "#{target}, #{config} configuration..."
            config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
            config.build_settings['HEADER_SEARCH_PATHS'] ||= ['$(inherited)']
            config.build_settings['VALID_ARCHS'] ||= ['armv6','armv7','armv7s','arm64', 'x86_64']
            config.build_settings['ARCHS'] ||= ['armv7','armv7s']
            config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
            config.build_settings['OTHER_LDFLAGS'] ||= ['$(inherited)']
            config.build_settings['OTHER_LDFLAGS'] << '-ObjC'
            #config.build_settings['OTHER_LDFLAGS'] << '-all_load'
            config.build_settings['LD_RUNPATH_SEARCH_PATHS'] ||= ['$(inherited)']
            config.build_settings['PODS_ROOT'] = '${SRCROOT}/Pods'            
        end
    end
end

Current issue

The error at now is the following (inside A2DynamicDelegate.h):

#import <BlocksKit/NSObject+A2BlockDelegate.h> file not found
#import <BlocksKit/NSObject+A2DynamicDelegate.h> file not found


At the same time I get such warnings in every target for both debug & release versions of the build:

The file “Pods.debug.xcconfig” couldn’t be opened because there is no such file. (.../MainProject/Pods/Target Support Files/Pods/Pods.debug.xcconfig)

So part of the files inside Pod is not found, even if stored in one single folder.

enter image description here

ashvardanian
  • 424
  • 1
  • 6
  • 17

1 Answers1

0

Fixed by rebuilding the architecture of the workspace and tweaking the contents of Xcode project package.

ashvardanian
  • 424
  • 1
  • 6
  • 17
  • Would it be possible to further explain what you mean by "tweaking the contents"? – Teepeemm Feb 29 '16 at 01:36
  • Yes, sure. When making changes in the structure of a huge workspace in Xcode you often face linker errors. When Xcode still stores the links to some 'ghost' files. Cleaning derived data wont help. Just view the content of project (its JSON-like) and delete the files that were moved. It will force Xcode to search through bundle again. – ashvardanian Feb 29 '16 at 01:40