2

I'm trying to integrate Urban Airship in my project using Cocoapods. Something that 'should' be simple, but is frustrating me to no end.

Why?

Because Xcode is unable to find the AirshipKit module; giving me the "Module 'AirshipKit` not found" error. Was using Xcode 7.3, which worked with Cocoapods, but after updating to Xcode 8 I'm unable to build my projects.


Let me give a context in which the error happens:

The Podfile I use looks as follows:

################
# Configuration
################

workspace 'MyWorkspace.xcworkspace'
project 'MainProject.xcodeproj'
project 'submodules/SubProject.xcodeproj'

install! 'cocoapods', :deterministic_uuids => false

# Uncomment this line to define a global platform for your project
 platform :ios, '8.0'

post_install do |installer_representation|
    installer_representation.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
            config.build_settings['SDKROOT'] = 'iphoneos'
            config.build_settings['ENABLE_BITCODE'] = 'NO'
        end
    end
end

################
# Pods
################

abstract_target 'Shared' do
  # Pods shared between both the Main and Sub targets
  pod 'UrbanAirship-iOS-SDK'
  pod 'TBXML', :inhibit_warnings => true

  # Pods for the Main Project
  target 'MainProject' do
    use_frameworks!
    project 'MainProject.xcodeproj', 'a_dev_server' => :debug, 'a_release_server' => :release, 'a_appstore_server' => :release

  end


  # Pods for the Sub Project
  target 'SubProject' do
    use_frameworks!
    project 'submodules/SubProject.xcodeproj', 'a_dev_server' => :debug, 'a_release_server' => :release, 'a_appstore_server' => :release

    pod 'Google/Analytics'
  end

end

I have a "Main" project which uses my own framework, beautifully dubbed "Sub".
As for the pods; I've updated all pods to their latest versions. Meaning that the UrbanAirship-iOS-SDK-pod currently is on version 8.0.0. Urban Airship itself states that the version should be compatible with Xcode 8.
In my file(s) I import the module (using @import AirshipKit;), but that gives me the not-found error.


The things I've tried:

  • Deleting the ModuleCache in my DerivedData folder
  • Deleting the DerivedData folder
  • Removed the pods and re-install/re-updated them
  • Building after marking the generated pods-framework as Optional and once as Required
  • Building after removing the @import statement, then rebuild the project (after getting all them lovely 'file not found' errors)
  • Manually adding the (Cocoapods generated) AirshipKit framework to the projects

Disclaimer: All above 'Things I've tried' have all been done by repeatedly cleaning the projects and build folders, restarting Xcode and sipping coffee after every error

Jokes aside; I probably tried a bunch of other stuff I can't remember. But Xcode refuses to 'find' the AirshipKit module.

Does anyone know what the problem might be?

Community
  • 1
  • 1
Gerald Eersteling
  • 1,244
  • 14
  • 28
  • Every major Xcode version we seem to have some issues with our pod spec. We tested it internally and are able to use it for internal projects, so we are pretty sure it works for everyone. However we have never used an abstract target. Could you try adding `use_frameworks!` to the abstract target? – ralepinski Sep 14 '16 at 18:39
  • Tried that @ralepinski , but sadly it didn't work – Gerald Eersteling Sep 15 '16 at 07:21

1 Answers1

0

Although this isn't exactly an 'answer', I got it working now.

The steps I took were:

  1. Uninstall the pods (again)
  2. Installed all pods, excluding the UA pod
  3. Manually added the AirshipKit framework (as described on UA's website)
  4. Successfully build my project
    • I also had to commit the project to my source control (Git). I don't know why, but Xcode8 seems to complain about missing files and whatsoever unless you commit them.
  5. Re-installed the UA pod
  6. Again; successfully build my project
    • Yes you're right Sherlock, at this point I had two AirshipKit frameworks in my project. My guess was that my project successfully build because the @import was seeing the manually added AirshipKit though
  7. Removed the manually added AirshipKit

After this, building my project just...worked.

Why?

"No idea."

Am I a happy developer again?

"Yep I am."

Gerald Eersteling
  • 1,244
  • 14
  • 28