Can I use a .xcframework inside a .framework?
When I try this the framework target builds fine, but when I use this framework in an iOS app target, it gives build error
For eg:
MyApp is iOS app target
MyFramework is a framework (embedded in MyApp)
MyXcFramework is a xcframework (embedded in MyFramework)
A sample swift file inside MyFramework contains
import Foundation
import MyXcFramework
and builds successfully
But when MyFramework is added to MyAapp i get the following error
import Foundation
import MyXcFramework <- No such module MyXcFramework
Can anyone help what I am doing wrong?
It seems like you are trying to use the xcframework without adding it to the app. If you want to use your xcframework in your app too you have to add that xcframework in your app target, you can avoid embedding xcframework in the framework and only embed for the app itself.
According to the documentation, it is not allowed in iOS. Apps with Dependencies Between Frameworks
An umbrella framework is a framework bundle that contains other frameworks. While it is possible to create umbrella frameworks for macOS apps, doing so is unnecessary for most developers and is not recommended. Umbrella frameworks are not supported on iOS, watchOS, or tvOS.
I had a framework, that had subframework, everything compiled sucessfuly, I shared the app with Diawi link. QA approved the build. When I tried to upload the build I had following error.
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!
I am trying to use a library (framework) into our iOS project (https://github.com/auth0/JWTDecode.swift). It provides a cocoapod interface to add/use the framework. But unfortunately in my project, we are not incorporated cocoapods and at this point it is not possible to integrate the cocoapods into our iOS project. So I down loaded the source code of the framework from git hub and build the framework. So I got the .framework file and that we added into our project. This framework is working fine in simulator and when try to build the ipa (archive) it fails and saying that
Use of unresolved identifier 'decode'.
The method 'decode' is one of the member of JWTDecode. Can someone help me to build the framework that works for both simulator and devices. I am not familiar with building frameworks in iOS.
I am using the JWTDecode framework for decoding the a JWT token.
The issue was due to the framework I built was only supporting for Simulator. I resolved the issue by building the framework for both device and simulator. The below post helped me on this.
https://medium.com/swiftindia/build-a-custom-universal-framework-on-ios-swift-549c084de7c8
I have a proprietary, dynamic iOS framework targeting iOS 8.0 above and using Swift. I want to distribute this in a precompiled form.
I tried building for release, copying over the framework to another project and adding it under the Embedded Frameworks section. However, I get the following error:
ld: framework not found MyFramework
If I remove my framework from the Linked Frameworks and Libraries section, my app compiles, but I cannot use the framework in my code.
How can I solve my problem?
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.