I have an existing iOS app which uses a framework which uses some CocoaPods. I added a WatchKit App target then added the framework to "Embedded Binaries". At this point, everything still compiles and runs. As soon as I import anything from the framework into the WatchKit extension though, I get an error that says
Could not build module 'FrameworkName'.
When I build, another error comes up inside one of the framework files:
'AFNetworking/AFNetworking.h' file not found.
Versions of AFNetworking prior to v2.6 would not support WatchOS without modification—see the AFNetworking requirements. As v2.6 was released after this question was posted, this seems certain to be the cause of the issues you were experiencing.
pod init again so that CocoaPods generates new targets for your Podfile.
Add your dependencies to both your main app and to your extension in the Podfile.
Related
I have very little experience in native iOS development but my current job is to wrap some specific native iOS framework to use it in React Native.
Preliminary data: common React Native tools generate an empty iOS library project and an example iOS app project that utilizes this library.
First I've tried to add the needed framework directly to the example app using CocoaPods - and it works fine, the framework became a part of linked libPods.a file, then if I add
#import MyTargetFramework;
to AppDelegate.m I can access different methods of the framework from it.
Next I switched to my iOS library project, applied the same setup (created a Podfile, added the same pod MyTargetFramework to it), then added the same #import MyTargetFramework to *.m file - but got a build error:
Module 'MyTargetFramework' not found
Also I've noticed that there is no libPods.a for iOS library project, all the pods are merged to a Pods.framework instead.
So my question is - what am I doing wrong? Why does it work for iOS app project, but not for iOS library project? How can I properly link my target framework to my own iOS library? I've already spent some time googling, but found nothing about app vs lib differences from this point.
I am integrating FrirebaseCrashlytics SDK in tvOS and iOS without cocopods. I downloaded their xcFramework. But I can't use the xcFramework as the project is not compatible so I drag and drop ios-armv7_arm64 framework to project and added Firebase.h and module.modulemap (my project uses both objc and swift). Also, I specified the Firebase.h in the bridging header. I get below error when I build.
Showing Recent Errors Only
/Users/xxxxx/Code/ios/tvOSApplications/App/App/Firebase.h:15:9: 'FirebaseCore/FirebaseCore.h' file not found
Showing Recent Errors Only
/Users/xxxxx/Code/ios/tvOSApplications/App/App/App-tvOS-Bridging-Header.h:27:9: Could not build module 'Firebase'
Multiple problems to address (based on instructions in the README at the base of the distribution:
The zip distribution requires Xcode 11 which supports xcframeworks
The zip distribution only supports iOS. tvOS is only distributed via CocoaPods
All Firebase installations require the xcframeworks in the Analytics folder to also be installed.
I am able to get firebasecrashlytic .framework files without cocopods using Carthage. I copied files to project and it works in iOS project. I am looking for a similar solution for tvOS
Recently I had a similar requirement of supporting Firebase on both iOS and tvOS. As the frameworks are available only on iOS and not on tvOS. I could not integrate Frameworks. So the solution I followed is adding of Source files provided in https://github.com/firebase/firebase-ios-sdk corresponding to the required modules that are needed for enabling Firebase Crashlytics.
This solution worked for me and able to see the crashes. Let me know if you need more information
I got Firebase Crashlytics working for tvOS without Cocoapods or XCFramework bundles. Basically, you just need to bring over the source files, set the header search paths, and set all the required preprocessor macros. You can read the story here.
Thanks for the hint Gangadhar!
After adding the Dropbox SDK Framework to my Xcode project (iOS) my project fails to build due to errors shown in image 1 below:
Prior to adding the Dropbox Framework, or reverting to the previous commit, results in the project building and running with out issue. I have also tested the same Dropbox SDK Framework package in a seperate demo project to ensure it is not corrupted - and that demo project builds and runs just fine, accessing the Dropbox SDK as expected.
Is it possible that the Dropbox SDK Framework is hiding or blocking access to the GLKit Framework within my main project?
Or is there something else at play here? The second error shown in screenshot claims the bridging header also 'Failed to import' which is an error I have not seen before, usually it is 'not found'.
The Dropbox SDK Framework is being added by drag-and-dropping into Xcode and checking the copy if needed box. Immediately after adding the Dropbox SDK Framework the project no longer builds and reports these errors.
I am answering my own question for anyone else who might have similar problems. While I did not find the root cause of the problem, I did get around it with the following solution.
I ended up removing all third party frameworks from my project which were:
ResearchKit Framework
Dropbox SDK Framework
Charts Framework
And in addition I removed all the XCode supplied frameworks from the project in the left hand file list: 'Project Title -> General -> Linked Frameworks and Libraries'
I then installed and setup CocoaPods with the project, and used CocoaPods to install and manage my third party frameworks (ResearchKit, Dropbox SDK and Charts)
The project is now able to build and run successfully and has access to the GLKit framework along with all other XCode supplied frameworks, bridging header and Dropbox SDK.
I assume this issue was due to a setting in XCode that was preventing access to GLKit after the Dropbox SDK had been added, and using CocoaPods to manage the integration of the third party frameworks skirted this issue.
If anyone has any further insight I'd be very interested to hear you explanation.
I've searched for hours but cannot find an answer. I have a xcode project with Cocoapods 0.39. in my Podfile i use !use_frameworks to enable a external Swift library in my Objective-C project.
But when i validate (or submit) with xcode, i get the codesigning dialog box. Normally only my app is shown but now it also shows the dynamic framework (cocoapods dependency). I think this is because of the !use_frameworks option.
The screenshot shows the dialog:
Screenshot
I can upload my binary to testflight and it will get processed but is this something i need to worry about? Is likely that apple will reject my app because of this?
There is nothing to worry about it, cocoapods are usually shown in codesigning dialog box, every cocoapod dependency that you will use will be shown there, there will be no issue and Apple will also not reject cocoapods
If you can upload your binary, I guess your minimum deployment target is iOS 8.0 or above, also in your Swift source code, you must
import AXRatingView
If your App's minimum deployment target is iOS 7, you can do this in the Podfile
#use_frameworks!
and comment
//import AXRatingView
then in your ...Bridging-Header.h
#import <AXRatingView/AXRatingView.h>
My App's minimum deployment target is iOS 7.0, ready for sale now.
I have a Cocoa Touch Framework that I developed for using in both my iOS app and my WatchKit app on iOS 8. I have no problems with iOS 8, however when I move the project to iOS 9 and update the WatchKit app to run natively I get the following error:
ParkFinderKit was rejected as an implicit dependency for 'ParkFinderKit.framework' because it doesn't contain platform 'watchsimulator' in its SUPPORTED_PLATFORMS 'iphonesimulator, iphoneos'
I attempted to manually add watchossimulator and watchos to the list of supported platforms:
However this produces another error:
ParkFinderKit was rejected as an implicit dependency for 'ParkFinderKit.framework' because its SDK is platform 'com.apple.platform.iphonesimulator' and it needs to match platform 'com.apple.platform.watchsimulator'
Any ideas as to how to solve my issue?
Okay, it looks like you cannot use a Cocoa Touch Framework inside of a WatchKit app. I was able to get around this by creating a new Watch Framework target and then assigning each file from the original framework to the new framework in the Target Membership options.
This accomplishes my goal of sharing code between iOS and WatchKit without having duplicate code.