Missing framework in ios develop of Xcode - ios

I have removed the framework from Xcode workspace and modified every place that importing that framework, and together with the building Parse of the project setting.
As there is no error showed in Xcode, I thought it's fine to compile, but during link time, there is error shows that the removed framework still needed.
Note that I have already cleaned the ~/Library/Developer/Xcode/DerivedData/ folder with rm -rf *
So how to check why this specific framework still needed to be linked? where to config that?
This shows that we are good with Xcode editor no error showed.
And this shows I have already removed the formwork cause the problem from the link parse
And here is the error when linking the project

The thing turns out to be I also have to remove the framework from
project -> build phases -> Embed Framworks

Related

iOS : Could not build module <framework-name>

I've got Library from another team. I'm trying to use library in our project and while do so getting an error Could not build module 'Common Library' (name of framework)
Below are solutions that I worked on but didn't helped :
1. Delete Derived data content. Clean and Build.
2. Framework is added in 'Link binary with libraries' of Build phases.
3. While adding framework checkmarked : Target and Copy content to folder.
Even I tried this stackoverflow-link but didn't got any break-through!
The only thing that worked was deleting Objective-C bridging header path in Swift compiler - code generation section of build settings in Project.
However, thereafter I'm not able to get Common interface to create instance (i.e. Common dosen't appears in drop-down list)
Below is framework structure.
Any other fix?
you can try delete DerivedData dir.
where is DerivedData?(xcode 8)
go to File > workspace Settings, you'll see DerivedData path.
DerivedData path in xcode 8
Check whether the framework you are integrating is supporting your project architecture.
To see the framework supported architecture, use Terminal and navigate to Framework folder.
use, "lipo -info myFramework.framework/MyFramework"
And, if you want to use the framework files in your project, check whether the files are available in Framework/Headers Folder.
Getting this error :
Try, "file myFramework.framework/MyFramework" in Terminal
I think you does not need to compile CommonLibrary.framework again. So you can try to remove it from Embedded Binaries list. And make sure the path of CommonLibrary.framework is in your Framework Search Paths.
I also had this problem:
1. My 'GoodLuck' framework had two headers: GoodLuck.h and GLAdder.h
2. Project which import this framework couldn't compile
Solution:
Import GLAdder.h in GoodLuck.h, rebuild the framework. It works.
I also had this problem, due to a typo in my GCC_PREPROCESSOR_DEFINITIONS, which therefore invalidated all of my code.
First helpful warning was multiple "Macro Name must be an identifier" followed by multiple "Could not build module" messages.
As this question do not have answer yet, so adding my answer here it may help in future for some another developer.
I know due to privacy you can not disclose the details.
I have used same library and faced same issue so just did did this two things it is working fine.
In General -> Frameworks,Libraries -> CommonLibrary.framework just select that and choose -> Embed Without Signing.
Build Settings -> Search for "workspace" -> Validate workspace -> set it NO
That's it you are done.

'Framework not found' in Xcode

I know this has been asked a couple of times. I followed instructions from these ones:
Adding frameworks to project in Xcode 5 and having *relative* paths added
xcode4: Linker error: Directory not found for option
Still Xcode is giving this error:
Here's my current configuration:
The bolts framework is so I can use the Parse SDK. I downloaded the blank project from here: https://parse.com/apps/quickstart#parse_data/mobile/ios/native/new
It's working. I tried to copy every config option, but it still doesn't work.
Try deleting Bolts.framework from linked framework and re-add it. Also, in your Framework Search Path keep path until Bolts.framework like $(PROJECT_DIR)/Bolts if it is inside Bolts folder at your project directory path.
I'm pretty new to iOS development. Apparently this problem for me was a result of opening the .xcodeproj Xcode project instead of the .xcworkspace Xcode workspace. I opened the workspace instead and the error has gone away.
error: Framework not found
If you use CocoaPods try to run:
pod deintegrate
pod update
Also use .xcworkspace instead of .xcodeproj
Delete the framework link from the Xcode project setting.
Move the framework to the Project Folder.
Re-add the framework in the Xcode project setting.
clean the project and re-compile it.
delete all frameworks from Embedded Binaries and re-add it
me too was getting this error , I moved the framework file to the root project folder and added to framework again and problem is solved.
1:- Delete the framework from the Xcode project. Quit the Xcode.
2:- Open your project in XCode and go to file under Menu and select Add files to "YourProjectName".
3:- Select "YourFramwork.framework" in the directory where you keep it.
4:- Click on the Copy items if needed checkbox.
5:- Click Add.
Make sure that you have the framework added in both Embedded Binaries and Linked Frameworks and Libraries under Target settings - General. As shown in the following images:-
Here is the solution :
Turn the "$(PROJECT_DIR)" attribute(might be non-recursive by default) into recursive option in Select Project Click on Targets Click - Build Settings Search for 'Framework Search Path' - Double click the input.
Scratched from https://stackoverflow.com/a/31298214/4493512
Besides from removing the framework from the Podfile and Linked Frameworks and Libraries, I also had to remove the reference to the framework in Other Linker Flags.
I just had the same situation (was having a hard time to address the OP's build error after adding a 3rd party framework) and it seems like a bug in Xcode (mine is 8.3.2 (8E2002)).
The problem was that a folder name in path to the framework contained spaces. In this case, Xcode incorrectly escaped them with backslashes like this in Build Settings -> Framework Search Paths:
$(PROJECT_DIR)/Folder\ with\ spaces/Lib
To fix this, just manually edit the entry to remove those backslashes and enclose the whole string in quotes like this:
"$(PROJECT_DIR)/Folder with spaces/Lib"
Delete the framework that is causing the issue (by removing the reference).
Then add it again, following these steps for adding FBSDK frameworks and libraries:
click project
general settings
linked framework and libraries
click the plus button and add all that you want
None of the above worked for me until I found that I had a blank "Any Architecture | Any SDK" line underneath Framework Search Paths / Debug under Build Settings.
Deleted the line and it works!
Error: Framework not found
If you use CocoaPods try to run these commands from terminal:
Intel chip:
pod deintegrate
pod update
Apple Silicon M1 chip:
pod deintegrate
arch -x86_64 pod update
Also use .xcworkspace instead of .xcodeproj
When this error occurred to me was because Pods folder was in iCloud and had no local copy on my computer. Go to your project's folder in Finder and check if there is iCloud's symbol in any of the folders inside it!
I realised that I hadn't run/built my framework with the Generic Device, which strangely lead to these issues. I just put the framework back in and it worked.
If you are using CocoaPods. Similar thing has happened to me. Although this question is old someone like me might still be struggling. So for to help:
after pod install it warns you about project files. I didn't notice till now. it says:
[!] Please close any current Xcode sessions and use
ProjectFile.xcworkspace for this project from now on.
So basically, do not continue working on .xcodeproj after installing Pods. If you do linker won't find files.
My framework has long name like FrameworkSDK_Light-1.0.6.framework so I renamed it to FrameworkSDK_Light.framework and it solved my problem.
I got the error 'AdBrixRM framework not found'. I checked the AdBrixRM.framework. I noticed that 'AdBrixRM' excution file is missed. I copied this file into the framework folder and the issue was gone.
I used to encounter this same exact issue in the past with Google Admob SDK. Most recently, this happened when trying to add Validic libraries. I tried the same old good trick this time around as well and it worked in a jiffy.
1) Remove the frameworks, if already added.
2) Locate the framework in Finder and Drag & Drop them directly into the Project Navigator pane under your project tree.
3) Build the project and Whooo!
Not sure what makes the difference, but adding the frameworks by the official way of going to the section "Linked Framework & Libraries" under project settings page (TARGET) and linking from there does not work for me. Hope this helps.
I found that the file.framework was referencing a file outside my project. So I dragged the file into my frameworks folder under my project and then got rid of the earlier file.framework file and it worked.
add github "BoltsFramework/Bolts-iOS" on your cartfile.
then carthage update.
after copy Bolts.framework from ../carthage/Build/iOS
Switching from iOS simulator to real device solved the problem for me.
Was facing the same error and solved it ---> Build Settings > Build Active Architecture Only = Yes
Please after adding both framework also open each Bolts and Parse framework and add Parse and Bolts to the project then problem will be solve
Running pod update in the root directory of the app fixed the issue for me.
If you are developing one module using cocoapods, try to comment the line
s.vendored_frameworks = "YOURMODULE.framework"
on YOURMODULE.podspec
The error will disappear after you generate and copy your YOURMODULE.framework to your project folder.
I had this issue on one of the project i worked, before you delete and readd the framework do a:
git status
on your project and check to see if the framework is not listed as deleted. In the event that it is either do a
git stash
or
git checkout *framework/file/path*

Warning message in existing project after upgrade to Xcode7

I have just recently upgraded to Xcode 7 and now I get this warning:
ld: warning: directory not found for option '-F/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/Developer/Library/Frameworks'
I researched different forums and everybody with similar issue recommends to remove paths from build settings but I can't find any paths there resembling iPhone simulators....
I had the same issue, here are the steps that worked for me
open your project
got to TARGETS
select youAppNameTests
select Build Settings
Framework Search Paths
Delete every thing from Debug and Release fields
clean project
Hope it will work for you too
The problem has to do with the test target. Delete your test target. (Copy the code out to some other program if there is any.) Quit Xcode and clean out the Derived Data folder. Now open your project again, and the problem will be gone. If necessary, now make a new test target.

Xcode 6.1 Link Binary with Libraries; Framework not showing up

I'm having issues getting a framework to work when checking out my project from a repository. If I check out the project I get a build error:
'Module SQLite not found'.
I went into Build Phases and checked that everything was properly set. I tried deleting the entry under Link Binary with Libraries and then re-adding it. This is where the issue occurs. When I go to add the framework, again, it doesn't show up.
For other parts of the Build Phase: Target Dependencies and Copy Files I can delete the entries and re add them and the framework still shows up no problem.
Unfortunately, I don't have enough reputation to post photos but the links to the Xcode screenshots can be found here: http://imgur.com/a/OfWLm
I'm assuming it's a configuration error because all of the required files are in the repository as well as the checkout folder. So if anyone could assist me in figuring out what needs to be changed, that would be greatly appreciated.
Note I'm using Xcode 6.1 and the framework in question is SQLite.swift found here.

Cannot add embedded binaries (other projects) to project dependencies in XCode

I have an XCode workspace created with XCode 6.0.1. It constains 2 (Swift) libraries and one iOS app (Swift) that depends on those 2 libraries. I had stable setup that allowed me to run the iOS app on both iPhone and simulators: The 2 library projects were added as Embedded Binaries (see picture) of the app.
Now, I have XCode 6.1. Recently, I deleted DerivedData folder in ~/Library/Developer/Xcode folder while XCode was running. After that my workspace did not work - the iOS app would fail to compile and I got linker error saying it cannot find the library projects.
I tried to solve it by removing my the 2 libraries from Embedded Binaries of the app project - and I cannot add them back. Clicking + button under Embedded Binaries in project settings displays workspace projects correctly but selecting and adding my library project does not add them to the list of Embedded Binaries. I have solved the linker error by creating new workspace. The app compiles but how it links the libraries is a mystery to me: They are not in listed Embedded Binaries or Linked Frameworks and Libraries not in the Frameworks search path. There appears to be no link between the app and the libraries it needs (and obviously have as it compiles) except that libraries projects are in the same workspace.
Why I cannot add library projects to Embedded Binaries? Is it normal in XCode 6.1 that dependency projects just compile and gets embedded into an app without being listed or linked anywhere?
This is a summary of my answer to the question Xcode won't add “Embedded binary” after deleting “DerivedData”, see the original question and answer for more context and information:
Remove all framework projects from the workspace
Perform a "clean build" and/or remove the "DerivedData"
Add project back into the workspace
Build the project (possibly optional)
In the General tab of the app target click the + under "Linked Frameworks and Libraries", select the framework.
Build and run in the Simulator (there should be no issues building or running)
Build and run for device (this might cause a crash due to the framework not being correctly linked, ignore this crash)
Click the + under "Embedded Binaries", select the framework. This should add it to the project (possible duplicate under "Linked Frameworks and Libraries")
Repeat for all required frameworks
Once building and running (on device) is confirmed you can remove any duplicate (and/or red) frameworks in the Project Navigator or target General tab
Ok, I ran into the same problem as you. After deleting the derived data, I could not re-link my binaries again. I think the reason is because the derived data is where the binaries are written to and linked against in your project.
What I did to solve was to select my Framework as my build target. After building it, the Framework target turned from red to black. I can see in your screenshot it is red, meaning it has not been compiled into a binary and written on disk.
Once I did this, I was able to re-link the Framework to my Project because there was a reference to it on disk. Hope this helps!
Clean your projects & build your framework first. Thereafter you can embed it.
Here is how I solved the problem:
Build the framwork.
Open the build folder and drag built framework into the app project (so it uses the path to DerivedData).
Add the framework to the list of embedded frameworks.
In the Finder, do a Show Contents on the app's xcodeproj file, then open project.pbxproj in your favorite text editor.
Find the line with the long DerivedData path. Change it so there is no name, the path is the framework name, and source tree is BUILT_PRODUCTS_DIR
Xcode should notice the change and the library in the app project will be black instead of red and will now build and run properly.
I have a very similar issue and fixed it just last night. Decided to come back to this thread and offer my workaround, as rjstelling's solution above did not help my case.
I have a workspace that contains two frameworks and one application. The App was making use of both frameworks happily for a while until I got hit by a mysterious compile eror where it decided that adding a property access to an instance variable called "cube" of a class type found in one of the framework, made access to "_cube" impossible (complaining it was not declared, while it had actually worked previously in a setter method).
Long story short, after a clean, somehow the workspace/app project lost track of the embedded framework of my iOS 8+ project. Removing the embedded framework was the last straw in that line of failure, causing my project to no longer allow be to select any frameworks for embedding.
Reverting the project & workspace to an earlier version did not get rid of the voodoo.
I ended up adding the to-be-embeded framework projects in the main app project (as files) and introduced target dependencies on the frameworks.
I was then able to re-embed the frameworks and link.
As for the _cube thing, I had to specify a getter for the property and #synthesize the property to a different name. I dont have an explanation for this one.
It's probably because your framework is a separate project and not a separate target. Try watching carefully Session 416: Building a Modern Framework at around minutes 34-36. It will show you how to set it up correctly.
This makes it a bit confusing if you wanted to share a framework across multiple projects by the way

Resources