Cocoa Touch Framework with CocoaPods dependencies - ios

I'm trying to create a Cocoa Touch Framework.
I created a Cocoa Touch Framework
I ran pod init
I added our own CocoaPod to this, which has some dependencies itself as well.
I ran pod install.
Now when I try to build the framework (I open the .xcodeproj) I get the following warnings for each dependency.
ld: warning: directory not found for option '-F/Users/jeroen/Library/Developer/Xcode/DerivedData/OurFramework-culynvrparvtfjbjlitmammotpkf/Build/Products/Debug-iphoneos/Alamofire'
I get the following errors:
ld: framework not found Alamofire
error: Resource "/Users/jeroen/Library/Developer/Xcode/DerivedData/OurFramework-culynvrparvtfjbjlitmammotpkf/Build/Products/Debug-iphoneos/FirebaseFirestore/gRPCCertificates-Firestore.bundle" not found. Run 'pod install' to update the copy resources script.
I expect that this is because the CocoaPod files are not copied to the right place. Is that correct?
What could I do to make this work anyway?
The reason I want to do this is the following:
I have a CocoaPods project which is a regular Xcode project with only Swift classes and some view controllers. We want to make this available as closed source. So I'm hoping that including this pod in a Cocoa Touch Framework would still make all public functions of its pods available to the user.
If there are other suggestions, they are welcome!
Thanks in advance.

The first point I got is you used .xcodeproj after pod installation. Please note that once you install pods there is one more file is created with an extension .xcworkspace you need to use this file to open project and your future work should be done in this file.

Okay, so all the problems I had with setting this up seemed to be Xcode-related.
Basically what I did to get this working is the following:
Create a Cocoa Touch Framework through Xcode's File > New > Project ....
Using terminal, navigate to the framework's root folder (the folder with the YourFramework.xcodeproj-file).
Run pod init.
Add the necessary CocoaPods to the Podfile.
Run pod install.
Make sure you close the YourFramework-project that's probably open in Xcode.
From here on my problems started occurring. Opening the YourFramework.xcworkspace worked, but in the left-side navigator of Xcode, I could only expand the Pods-project, not the Framework-project; it seemed to be empty. Building didn't work either.
To solve this (So, just the regular steps to solve Xcode problems):
Close Xcode.
Delete derived data.
Open the YourFramework.xcworkspace again.
Clean the build folder.
Now it maybe builds, or not. In my case it didn't and got 100s of problems related to the Swift language being unavailable. I created a framework without any source files, just imported CocoaPods. To solve this create a Swift file in the framework which imports at least Foundation.
Now it should build.

Related

Error - linker command failed with exit code 1

I'm new to XCode Mac and IPhone development. So probably I'm missing something obvious here.
While trying to build the project I'm getting the following warnings and error. I can't figure out what is wrong here, I've looked at this answer and checked my Framework Search Path value and there is none in BuildSettings.
ld: warning: directory not found for option '-F/Users/macbook/Desktop/<app_name>__main/build/Release-iphoneos'
ld: warning: directory not found for option '-F/Users/macbook/Desktop/<app_name>__main/build/Debug-iphoneos'
ld: framework not found Pods_<app_name>
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've been banging my head for several hours now and finally given up.
The path mentioned in the error does not exist and when I looked into where build folder is located in XCode project, I realized they are in a shared directory ~/Library/Developer/Xcode/DerivedData. So I don't understand why XCode is looking for these files in the project's relative path, where build folder doesn't exist.
I'm using
XCode 10.1
CocoasPod 1.5.3 1.8.4
MacOS High Sierra
Note: The same workspace builds successfully on another system.
Edit:
If I copy the project.pbxproj from the other system onto this one, the project on this machine builds successfully too. project.pbxproj is located under *.xcodeproj file.
Also if I select Generic iOS Device the project builds fine, but as soon as I switch to any other target device I get the same error.
Edit 2:
I see a couple of framework files in red in the left side folder/directory's panel.
Foundation.framework
Pods_<application_name>.framework
Solution:
So right now I've found a solution what I believe to be a workaround and not the actual solution.
In my project's folder structure I saw multiple .framework files in red. some of them had different extensions then the ones present in the xCode package. So I updated them with the newer extension files and that got rid of most of the red file frameworks and left just one Pods_.framework the same framework in the error above. I removed the framework from the Libraries and Framework list in the General section. After I did that project build fine and I was able to run the app.
However, I noticed the Pods_<app_name>.framework file is always regenerated after running pod install. So I have to manually remove this unwanted dependency from the list each time starting a new workspace which is pain to say the least.
And so now I'm looking for a way to correct this so I don't have to remove the Pods_<app_name>.framework file each time.
While I was searching for the solution I found a closed cocoapods bug which reported the same issue for an older version. I've lost the thread and cannot find it again otherwise I would've linked the bug.
As noted in one of the answer's comment I now have updated cocoapods version 1.8.4.
Edit 3:
Podfile
# Uncomment this line to define a global platform for your project
# platform :ios, '7.0'
# Uncomment this line if you're using Swift
use_frameworks!
target '<app_name>' do
pod 'Google-Mobile-Ads-SDK', '~> 7.39.0'
end
Based on your comment and build logs I believe the podfile Pods_<application_name> is not available to your project(its added but not downloaded).
Pods are a way to share code across projects and maintain versioning.
You just need to update the pod so that it gets downloaded and added to your project. For that just launch Terminal app, cd to your project folder and fire pod update (you may refer to https://freakycoder.com/ios-notes-12-how-to-update-pods-249ecf88fe57)
If you do not have pod installed you can head to https://guides.cocoapods.org/using/using-cocoapods.html
I used to run into that problem once but I already solved it the same way #alxlive answer and it worked.
The problem happened to me because of the pod that we already installed.
During that time, I already installed my cocoapod for my project. Then, I added 2 new Build Configurations.
Your problem might be the same because you did mention copying others project.pbxproj from other system and it made your project work fine. So that might be the case.
By deintegrate and install the pod back on, that will solve the problem.
Xcode has different build system for simulator and real devices. So it will generate different app for both. If you select any Simulator target then it will builds app for simulator and if you select Generic iOS Device or any real device target then it will builds different build.
May be you are using some frameworks which are builded for iOS devices, So
follow this steps,
Differentiate that frameworks which gives you an error and remove that pods from your pod file and run pod install command and delete DerivedData.
Download that framework's code in your system.
Add project files of framework in your workspace. For that you can refer this and this.
If you don't want to add whole code of framework in your project then you can add particular( for device or simulator ) build of framework in your xcode project.
For that follow this steps,
Open your downloaded project of framework.
Select any simulator target and build project.
Get generated .framework file from Products folder.
Add this framework in your project like this.
Now build your project for simulator.
Follow above steps for devices target if you want to build for devices.
For Google Mobile Ads you can follow this guidelines. Add the -ObjC linker flag to Other Linker Flags in your project's build settings
I hope this will work for you.
Adding -ObjC $(inherited) in the Other Linker Flags fixes my issue
For me it was due to having a space in the Configuration name like "Development Debug". Once I removed the space and made it "DevelopmentDebug", the error message went away.
The pods need to be installed once per mac. The configuration set in the project.pbxproj depends on the Cocoapods version and the Xcode version on the machine.
Try the following:
1 - Delete the Podfile.lock file and the Pods folder from the local project
2 - Delete the content of the Derived Data folder: ~/Library/Developer/Xcode/DerivedData
3 - Run the command:
pod deintegrate
4 - Run the command
pod install
5 - Run the project again

Error "No such module" when import framework in Swift file [duplicate]

I'm currently coding in Swift, and I've got an error:
No such module Social
But I don't understand, because the module is in my project, declared in "Linked frameworks and Libraries" and in "Embedded Binaries".
The frameworks is in Objective-C, so I wrote a Bridge Header for it.
Please, how can I make Xcode recognize the framework?
In case it's Friday afternoon or anytime after 1am:
Opening xcodeproj instead of xcworkspace will cause an error like this...
I'm not sure why this happens, but one way to solve your issue is to go into your build settings and defining the Framework Search Paths to a folder which contains the frameworks in question. If the frameworks are placed in your project directory, simply set the framework search path to $(SRCROOT) and set it to recursive.
Make sure that the naming of you configurations in the sub projects matches that of the "parent" project. If the configuration naming don't match exactly (case-sensitive), Xcode will abort the archive process and show the error "No such module ..."
That is, if you have a "parent" project with a configuration named "AppStore" you must make sure that all subprojects also have this configuration name.
See my attached screenshots.
I am not quite sure why Martin R's answer in the comments for the question is so disregarded:
Make sure that you tried simply skipping import of the framework as it is already added with the bridging header.
Hope this helps
I had the same issue using Cocoapods and Swift. I didn't notice the following lines in the Podfile:
# Uncomment this line if you're using Swift
# use_frameworks!
So, all I had to do was change it to:
# Uncomment this line if you're using Swift
use_frameworks!
...aaand it worked :)
The following steps worked for me.
Quit xcode
Run "pod update" in terminal
Open .xcworkspace and build again.
Please compare this screenshot with your build setting.
It may this work.
Go to the framework search path:
I was experiencing this problem as well. The fix for me was that the Archive schemes between the two projects didn't match. I have an xcworkspace with a framework project and an app project. The problem was that in the Archive scheme for my app, I was using a different Build Configuration than the framework was using for it's Archive scheme. I set both Build Configurations to Release, and that fixed the issue.
In my case, after many attempts to figure out what I was doing wrong importing a framework I eventually discovered that the framework itself was the problem. If you are not getting your framework from a trusted source you should inspect the framework and ensure that it contains a Modules folder with a module.modulemap file inside it. If module.modulemap is not present, you will get the "No such module 'MyFramework'" error.
If the Modules folder is missing the "MyFramework.swiftmodule" folder then the framework will be found but Xcode won't know about its contents so you will get different errors.
No such module Compile error
It is compile time error. You can get it in a lot of case:
.xcodeproj was opened instead of .xcworkspace
module.modulemap or .swiftmodule[About]
Objective-C Library/Framework Target
make sure that generated binary contains module.modulemap file and it's headers are located in Build Phases -> Headers section
Framework Search Paths
consumer -> framework
If you try to build an app without setting the Framework Search Paths(consumer). After setting the Framework Search Path to point to the framework resources, Xcode will build the project successfully. However, when you run the app in the Simulator, there is a crash for reason: Image not foundabout
It can be an absolute path or a relative path like $(SRCROOT) or $(SRCROOT)/.. for workspace
Import Paths
Swift consumer -> Swift static library
The Import Paths(consumer) should point to .swiftmodule
Find Implicit Dependencies
When you have an implicit dependency but Find Implicit Dependencies was turned off
CocoaPods
Check if this dependency is existed in a target
pod deintegrate
pod install
CocoaPods UI Test Bundle
for App Target where used additional dependency from CocoaPods. To solve it use inherit![About] in Podfile
[Recursive path]
Assuming the Framework really is there and in the path, etc... delete the ~/Library/Developer/Xcode/DerivedData/ModuleCache directory (and clean the project and delete the project-specific derived data for good measure).
When you do the standard cleanup, the ModuleCache directory doesn't get rebuilt.
Be sure, that Find implicit Dependencies in Build options in Scheme is on!
There are several potential misconfigurations the issue can arise for,
Please confirm that you have opened the .xcworkspace but not .xcodeproj file. Also make sure you have build Social first before you build TriviaApp.
Make sure that iOS Deployment Target is set same for all modules with main app. For example is TriviaApps deployment target is set to 9.0, Socials deployment target also need to be set to 9.0.
Make sure your main module (TriviaApp) and your used framework (Social) have same set of configurations. i.e. If your Project has three configurations, Debug, Release, ReleasePremium than your Social framework also need to have three configurations Debug, Release, ReleasePremium. Also make sure that the archive configuration is set same for both TriviaApp and Social. i.e. if your TriviaApps archive scheme is set to ReleasePremium, your Socials archive scheme also need to be set into ReleasePremium.
Please assure that you do not need to import Social in each .swift files when its already added in the Bridging-Header.h.
In case of issue came from Pod files, make sure you have uncommented #use_frameworks! into use_frameworks! from you Podfile. Sometime re installing pod works if Social has any dependency on pods.
If none of the above steps works, delete your derived data folder and try re building.
For me Build Active Architecture Only was set to Yes for the selected configuration. This did the trick:
Select "Pods" from the left project navigator > Select "Build Settings" > Build Active Architecture Only to No
What worked for me is this solution to another question. Closing Xcode and reopening the project as workspace. Go to your project folder and open .xcodeworkspace file.
Once you open the workspace (instead of project), Pods should appear as top level project in Project Navigator.
I also encountered the same error a few days back. Here's how I resolved the problem:
The error is "module not found"
Create Podfile in your root project directory
Install cocoapods (a dependency manager for Swift and iOS projects)
Run pod install
Go to Project Build Settings:
Find Objective-c bridging Header under Swift compiler - Code Generation (If you don't find Swift compiler here, probably add a new Swift file to the project)
Drag and drop the library header file from left side to bridging header (see image attached)
Create a new bridging header file: e.g TestProject-Bridging-Header.h and put under Swift Compiler → Objective-C Generated Interface Header Name (ref, see the image above)
In TestProject-Bridging-Header.h file, write #import "Mixpanel/Mixpanel.h"
In your Swift file the code should be:
Import Mixpanel (i.e name of library)
That's all.
Ok, how the same problem was resolved for me was to set the derived data location relative to the workspace directory rather than keeping it default.
Go to preferences in xcode. Go to locations tab in preferences and set Derived data to Relative.
Hope it helps.
I was getting same error for
import Firebase
But then noticed that I was not adding pod to the main target section but only adding to Test and TestUI targets in Podfile.
With the command
pod init
for an xcode swift project, the following Podfile is generated
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'MyApp' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for MyApp
target 'MyAppTests' do
inherit! :search_paths
# Pods for testing
end
target 'MyAppUITests' do
inherit! :search_paths
# Pods for testing
end
end
So, need to make sure that one adds pods to any appropriate placeholder.
Sometimes pod deintegrate and then pod install helps me, too.
As for xCode 12 and simulators,
the error might disappear when you navigate to Pods.xcodeproj in project navigator,
and in build settings under the 'Excluded Architectures', for every Debug and Release, chose 'Any iOS Simulator SDK' with value arm64.
If you're building for a platform like tvOS, make sure you have an Apple TV (i.e. matching) simulator selected.
Building a tvOS app with an iOS simulator selected gave me exactly this error. Spent the better part of an hour looking for all sorts of build issues... doh.
I was getting the same error as i added couple of frameworks using Cocoapods. If we are using Pods in our project, we should use xcodeworkspace instead of xcodeproject.
To run the project through xcodebuild, i added -workspace <workspacename> parameter in xcodebuild command and it worked perfectly.
In my case the app the IPHONEOS_DEPLOYMENT_TARGET was set to 9.3 whereas in my newly created framework it was set to 10.2
The implicit dependencies resolver ignored my new framework because the requirements of the target platform are higher than the app requirements.
After adjusting the framework iOS Deployment Target to match my application deployment target the framework compiled and linked successfully.
I was having a similar issue with xcode 10.3. xCode was unable to recognise files from pods. Here I have solved this way:
Go to Build Phase
Link Binary with Libraries
Add framework from pods (in my case EPSignature.framwork)
Clean & build the project
Error is gone.
TL;DR: Check your Podfile for target-specific shared_pods
After beating my head against the wall and trying literally every single other answer posted here over the last week, I finally found a solution.
I have two separate targets - one for release and one for development. The development target was created long after the release target, which lead me to forget some setup steps for that target.
I was able to get my project to compile properly using my release target, but my development target was having an issue.
After looking at my Podfile for the twentieth time, I noticed that I only had the following, under my shared_pods definition:
target 'Release' do
shared_pods
end
What I needed to do was add my second target to my Podfile, and that fixed the issue:
target 'Release' do
shared_pods
end
target 'Development' do
shared_pods
end
Hopefully this saves someone a few days of frustration.
Resolve issue of Webview of apple iOS xcode Version 12.3 (12C33)
Simply Do 3 steps:
Open project with .xcodeproj
Quit Xcode
Reopen project from .xcworkspace
All Done
I found that the Import Paths in the Build Settings was wrong for a custom (MySQL) module. After pointing that to the right direction the message was gone.
I fixed this with
Targets -> General -> Linked frameworks and libraries
Add the framework which should be at the top in the Workspace folder. Pain in the arse.
I just deleted my cocoapod. Then, I did a pod install to remove it. Then, I just added it back into my podfile and re-installed it. That made it work. Not sure why.
I had already installed pods. Build worked without any problems when I builded application on my device, but archive didn't work. I just run:
pod install
no new pods were installed, just .xcodeproj file got regenerated and archive started working

Framework not found GoogleMapsCore

I am using the Google Maps framework in my iOS app. But I cant seem to understand what is causing the error: Framework not found GoogleMapsCore.
Yes I know that it can't find that module. But I can see it in the Pods folder. See the image below.
I even added the link to that folder in the Framework Search Path.. see image below.
Do you have any idea?
Generally, this is an indication that the Pods projects is not properly built. The best way to solve this is to remove the GoogleMaps pods from your Podfile, run pod install. This will remove the GoogleMaps Framework. Then edit the Podfile again, add the GoogleMaps framework and run pod install again. This will reinstall the pods, and regenerate the Pods Project linking all your frameworks properly to your app. It almost always works for this error - Framework not found.
A good place to start would be those red files. See all those red filenames? They are missing from the project. You need to build them.
Look up cocoapods and follow the instructions to create your workspace file. [it's just one simple install command]
Always from now on, when working on this project, instead of
ProjectName.xcodeproj (blue avatar) you should double-click on the ProjectName.xcworkspace (white avatar) file. That will open the project in Xcode. And the filenames should no longer be red.
I had the same problem. For me I needed to remove armv7s from the valid Architectures. I guess GoogleMaps (2.3.1), which is what I am using, does not build against that architecture.
Delete your PODS folder, and run pod install again.

library not found for -lAsyncDisplayKit

In my project I get the following error in Xcode:
library not found for -lAsyncDisplayKit
My project was configured with pod.
Can anyone help me fix it?
Here you can find some FAQ to resolve main issues with Cocoapods. You have also to check the architecture for the single project and target. If you use a different architecture, Xcode doesn't compile the others and so it will never find the libs
After run pod install or pod update you must use the new <YourProject>.xcworkspace file instead of the old <YourProject>.xcodeproj file.
It happens because .xcworkspace contains your .xcodeproj and the pods.
After that you should be able to run normally.

Getting error "No such module" using Xcode, but the framework is there

I'm currently coding in Swift, and I've got an error:
No such module Social
But I don't understand, because the module is in my project, declared in "Linked frameworks and Libraries" and in "Embedded Binaries".
The frameworks is in Objective-C, so I wrote a Bridge Header for it.
Please, how can I make Xcode recognize the framework?
In case it's Friday afternoon or anytime after 1am:
Opening xcodeproj instead of xcworkspace will cause an error like this...
I'm not sure why this happens, but one way to solve your issue is to go into your build settings and defining the Framework Search Paths to a folder which contains the frameworks in question. If the frameworks are placed in your project directory, simply set the framework search path to $(SRCROOT) and set it to recursive.
Make sure that the naming of you configurations in the sub projects matches that of the "parent" project. If the configuration naming don't match exactly (case-sensitive), Xcode will abort the archive process and show the error "No such module ..."
That is, if you have a "parent" project with a configuration named "AppStore" you must make sure that all subprojects also have this configuration name.
See my attached screenshots.
I am not quite sure why Martin R's answer in the comments for the question is so disregarded:
Make sure that you tried simply skipping import of the framework as it is already added with the bridging header.
Hope this helps
I had the same issue using Cocoapods and Swift. I didn't notice the following lines in the Podfile:
# Uncomment this line if you're using Swift
# use_frameworks!
So, all I had to do was change it to:
# Uncomment this line if you're using Swift
use_frameworks!
...aaand it worked :)
The following steps worked for me.
Quit xcode
Run "pod update" in terminal
Open .xcworkspace and build again.
Please compare this screenshot with your build setting.
It may this work.
Go to the framework search path:
I was experiencing this problem as well. The fix for me was that the Archive schemes between the two projects didn't match. I have an xcworkspace with a framework project and an app project. The problem was that in the Archive scheme for my app, I was using a different Build Configuration than the framework was using for it's Archive scheme. I set both Build Configurations to Release, and that fixed the issue.
In my case, after many attempts to figure out what I was doing wrong importing a framework I eventually discovered that the framework itself was the problem. If you are not getting your framework from a trusted source you should inspect the framework and ensure that it contains a Modules folder with a module.modulemap file inside it. If module.modulemap is not present, you will get the "No such module 'MyFramework'" error.
If the Modules folder is missing the "MyFramework.swiftmodule" folder then the framework will be found but Xcode won't know about its contents so you will get different errors.
No such module Compile error
It is compile time error. You can get it in a lot of case:
.xcodeproj was opened instead of .xcworkspace
module.modulemap or .swiftmodule[About]
Objective-C Library/Framework Target
make sure that generated binary contains module.modulemap file and it's headers are located in Build Phases -> Headers section
Framework Search Paths
consumer -> framework
If you try to build an app without setting the Framework Search Paths(consumer). After setting the Framework Search Path to point to the framework resources, Xcode will build the project successfully. However, when you run the app in the Simulator, there is a crash for reason: Image not foundabout
It can be an absolute path or a relative path like $(SRCROOT) or $(SRCROOT)/.. for workspace
Import Paths
Swift consumer -> Swift static library
The Import Paths(consumer) should point to .swiftmodule
Find Implicit Dependencies
When you have an implicit dependency but Find Implicit Dependencies was turned off
CocoaPods
Check if this dependency is existed in a target
pod deintegrate
pod install
CocoaPods UI Test Bundle
for App Target where used additional dependency from CocoaPods. To solve it use inherit![About] in Podfile
[Recursive path]
Assuming the Framework really is there and in the path, etc... delete the ~/Library/Developer/Xcode/DerivedData/ModuleCache directory (and clean the project and delete the project-specific derived data for good measure).
When you do the standard cleanup, the ModuleCache directory doesn't get rebuilt.
Be sure, that Find implicit Dependencies in Build options in Scheme is on!
There are several potential misconfigurations the issue can arise for,
Please confirm that you have opened the .xcworkspace but not .xcodeproj file. Also make sure you have build Social first before you build TriviaApp.
Make sure that iOS Deployment Target is set same for all modules with main app. For example is TriviaApps deployment target is set to 9.0, Socials deployment target also need to be set to 9.0.
Make sure your main module (TriviaApp) and your used framework (Social) have same set of configurations. i.e. If your Project has three configurations, Debug, Release, ReleasePremium than your Social framework also need to have three configurations Debug, Release, ReleasePremium. Also make sure that the archive configuration is set same for both TriviaApp and Social. i.e. if your TriviaApps archive scheme is set to ReleasePremium, your Socials archive scheme also need to be set into ReleasePremium.
Please assure that you do not need to import Social in each .swift files when its already added in the Bridging-Header.h.
In case of issue came from Pod files, make sure you have uncommented #use_frameworks! into use_frameworks! from you Podfile. Sometime re installing pod works if Social has any dependency on pods.
If none of the above steps works, delete your derived data folder and try re building.
For me Build Active Architecture Only was set to Yes for the selected configuration. This did the trick:
Select "Pods" from the left project navigator > Select "Build Settings" > Build Active Architecture Only to No
What worked for me is this solution to another question. Closing Xcode and reopening the project as workspace. Go to your project folder and open .xcodeworkspace file.
Once you open the workspace (instead of project), Pods should appear as top level project in Project Navigator.
I also encountered the same error a few days back. Here's how I resolved the problem:
The error is "module not found"
Create Podfile in your root project directory
Install cocoapods (a dependency manager for Swift and iOS projects)
Run pod install
Go to Project Build Settings:
Find Objective-c bridging Header under Swift compiler - Code Generation (If you don't find Swift compiler here, probably add a new Swift file to the project)
Drag and drop the library header file from left side to bridging header (see image attached)
Create a new bridging header file: e.g TestProject-Bridging-Header.h and put under Swift Compiler → Objective-C Generated Interface Header Name (ref, see the image above)
In TestProject-Bridging-Header.h file, write #import "Mixpanel/Mixpanel.h"
In your Swift file the code should be:
Import Mixpanel (i.e name of library)
That's all.
Ok, how the same problem was resolved for me was to set the derived data location relative to the workspace directory rather than keeping it default.
Go to preferences in xcode. Go to locations tab in preferences and set Derived data to Relative.
Hope it helps.
I was getting same error for
import Firebase
But then noticed that I was not adding pod to the main target section but only adding to Test and TestUI targets in Podfile.
With the command
pod init
for an xcode swift project, the following Podfile is generated
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'MyApp' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for MyApp
target 'MyAppTests' do
inherit! :search_paths
# Pods for testing
end
target 'MyAppUITests' do
inherit! :search_paths
# Pods for testing
end
end
So, need to make sure that one adds pods to any appropriate placeholder.
Sometimes pod deintegrate and then pod install helps me, too.
As for xCode 12 and simulators,
the error might disappear when you navigate to Pods.xcodeproj in project navigator,
and in build settings under the 'Excluded Architectures', for every Debug and Release, chose 'Any iOS Simulator SDK' with value arm64.
If you're building for a platform like tvOS, make sure you have an Apple TV (i.e. matching) simulator selected.
Building a tvOS app with an iOS simulator selected gave me exactly this error. Spent the better part of an hour looking for all sorts of build issues... doh.
I was getting the same error as i added couple of frameworks using Cocoapods. If we are using Pods in our project, we should use xcodeworkspace instead of xcodeproject.
To run the project through xcodebuild, i added -workspace <workspacename> parameter in xcodebuild command and it worked perfectly.
In my case the app the IPHONEOS_DEPLOYMENT_TARGET was set to 9.3 whereas in my newly created framework it was set to 10.2
The implicit dependencies resolver ignored my new framework because the requirements of the target platform are higher than the app requirements.
After adjusting the framework iOS Deployment Target to match my application deployment target the framework compiled and linked successfully.
I was having a similar issue with xcode 10.3. xCode was unable to recognise files from pods. Here I have solved this way:
Go to Build Phase
Link Binary with Libraries
Add framework from pods (in my case EPSignature.framwork)
Clean & build the project
Error is gone.
TL;DR: Check your Podfile for target-specific shared_pods
After beating my head against the wall and trying literally every single other answer posted here over the last week, I finally found a solution.
I have two separate targets - one for release and one for development. The development target was created long after the release target, which lead me to forget some setup steps for that target.
I was able to get my project to compile properly using my release target, but my development target was having an issue.
After looking at my Podfile for the twentieth time, I noticed that I only had the following, under my shared_pods definition:
target 'Release' do
shared_pods
end
What I needed to do was add my second target to my Podfile, and that fixed the issue:
target 'Release' do
shared_pods
end
target 'Development' do
shared_pods
end
Hopefully this saves someone a few days of frustration.
Resolve issue of Webview of apple iOS xcode Version 12.3 (12C33)
Simply Do 3 steps:
Open project with .xcodeproj
Quit Xcode
Reopen project from .xcworkspace
All Done
I found that the Import Paths in the Build Settings was wrong for a custom (MySQL) module. After pointing that to the right direction the message was gone.
I fixed this with
Targets -> General -> Linked frameworks and libraries
Add the framework which should be at the top in the Workspace folder. Pain in the arse.
I just deleted my cocoapod. Then, I did a pod install to remove it. Then, I just added it back into my podfile and re-installed it. That made it work. Not sure why.
I had already installed pods. Build worked without any problems when I builded application on my device, but archive didn't work. I just run:
pod install
no new pods were installed, just .xcodeproj file got regenerated and archive started working

Resources