Parse framework keeps unlinking - ios

Every time I open my XCode project in XCode 7.1.1, I get the error: "No such module Parse" wherever I import Parse.
However, I have the Parse framework correctly added in my Build Phases, and the only way to fix this is by deleting the Parse framework listed in my Build Phases and re-adding it like I did the first time.
I have to do this every time I reopen an XCode project, and it's extremely annoying, but able to be worked around. Does anyone have any permanent fixes for this?
Thank you!

I suggest using CocoaPods to install Parse for Swift using the following Podfile:
platform :ios, "8.0"
use_frameworks!
pod 'Parse'
Parse can then be installed with
pod install

Related

Xcode 10 build fails with 'Command CompileSwift failed with a nonzero exit code

I updated Xcode to version 10 recently and started to receive a strange error when trying to build my project. I'm currently on Swift 4.0 and I did try to upgrade to swift Version 4.2. But when I did I received this same error in many of my frameworks.
Command Compile Swift failed with a nonzero exit code
So far I've deleted the derived folder. Updated all pods, also deleted all pods and reinstalled them using the terminal commands below.
sudo gem install cocoapods-deintegrate cocoapods-clean
pod deintegrate
pod clean
pod install
This didn't work to fix my issue. However, I found something that could work which was adding arm64 architecture in Build Setting -> valid architectures and enabling automatic code But, when I checked it was already there and code signing was enabled already.
Additionally, I do have a few other build errors that have to do with frameworks.
SwiftMessages
Value of type 'SwiftMessages.Config' has no member 'presentationContext'
WhatsNewKit
Missing argument for parameter 'backgroundColor' in call`
I opened issues with the developers of each of these frameworks to seek help with these issues.
Issue On SwiftMessage GitHub
Issue On WhatsNewKit GitHub
When I click presentationContext it brings me to the struct within the SwiftMessages Framework. Usually, when I've had the "has no member" warning I cannot click to see the original place where it exists.
I assume this has something to do with cocoa pods, but haven't been able to find a solution yet. What can I do to correct this issue? If anyone could help would be deeply appreciated been stuck on this for a day now.
Update:
The two frameworks latest builds were for swift 4.2. When I changed the version of each framework to one that was built in swift 4.0 I got the project to build.
Make sure that, your project Swift Language Version is in the proper version. SwiftMessages 6.0.0 works with Swift 4.2.
I solved this way:
Comment all pods in your .pod file
From your terminal, run the command pod install --no-repo-update
Open Xcode perform a clean and rebuild the project
Now open your .pod file and uncomment the first library
From your terminal, run the command pod install
Repeat steps 2 - 3 - 4 -5 for each uncomment library in your .pod file
I hope it can be of your help.
Make sure that, Your project build settings Optimization Level is in No Optimization[-Onone].
for pod SwiftMessages if your app is not swift 4.2 you need to user the version 5.01
pod 'SwiftMessages', '~> 5.0.1'
and it will work like a charm
Set Swift version to 4.2 then pod deintegrate, pod install, fix this problem for me. Thanks #alejandro-iván
Good Morning!
Do a clean. using"commond + shift + k
Close Xcode.
Navigate to project directory where the Podfile exist.
Do pod update/pod install
Open x.xcworkspace
This error happened to me when I used same class name in two different groups. Then I renamed one of the classes and the problem was solved
All of the answers were helpful to me. In my case, I only install frameworks manually but this kind of problem also happens. I tried all of the answers and was still getting this issue during the build. Curiously, while coding, I could cmd-click and resolve all of the "missing" components. I also cleaned and deleted derived data, restarted Xcode, etc.
I eventually got it working by inducing these additional steps:
On each of the framework project/targets (including my own):
Verify consistent Swift version (4.2 in my case)
Set Build for Active Architecture Only to No
Set Valid Architecture to arm64, armv7 (to match with base project)
Set Optimization Level to None (for Debug)
Set Compilation Mode to Whole
I had several frameworks (homegrown) plus my app. Somehow they ended up being out of sync as far as the Swift version. Make sure that all frameworks are the same version. In my case, they all needed to be set to Swift 4.2. If you haven't done the migration to 4.2 then remember that Xcode helps with this: Edit -> Convert -> To Current Swift Syntax.
only for re-install pod using that command pod install
see below attachment
In my case I connect an actual iphone not simulator and run the app once on it, It solved the problem. But connect iphone firstly, then choose it from this menu, then press run button.
The problem will solve too.
I stumbled upon this problem when upgrading to Xcode 10.2 and Swift 5. After trying everything I found this in the release notes:
The Swift compiler may crash during a build when the Thread Sanitizer
is enabled. (48719789)
And sure enough, efter turning off Thread Sanitizer my project could be compiled without errors again.
So if you get this error and have Thread Sanitizer enabled - turn it off!
Same issue happened to me in Xcode 10.2, it was a Xcode bug..!
So, I opened in older Xcode version(9.4), and it worked fine. Then I updated to the Xcode 10.2.1 after it's release -> Clean and build your project, now my problem solved.
I'm having the same problem, my Xcode version is 10.2.1 (10E1001),
Cocoapods version is 1.7.0.beta.2.
I returned to Cocoapods 1.6.1 and the problem was solved.
The specific steps are:
pod deintegrate to cancel the integration.
Uninstall all Cocoapods.
for i in $( gem list --local --no-version | grep cocoapods );
do
gem uninstall $i;
done
Install the stable version of Cocoapods. For now it's 1.6.1.
gem install cocoapods
Clean Project and empty DerivedData⁩
pod install
Recompile the project
In my case it was a code error:
self.myDto.map{ (dto)} in
var stringValue = (dto.value(forKey: "name") as! String)
stringValue.append("c")
return stringValue
}
Just removed that stringValue variable fixed the problem.
I just had the same error message and none of the answers here and in the duplicates of this question were applicable to my project or helpful.
I kept on reading through the error messages and came to a realisation that I had stupidly named two seperate swift files in different folders with the same name intending to change one, but before I got to change one, I tried to run my project and have been annoyed for the last hour.
Bottom line, don't accidentally name your files the same name and read your error codes thoroughly!
target 'XYZ' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for xyz
pod 'SwiftyJSON'
pod 'Localize-Swift'
pod 'Alamofire'
pod 'Kingfisher'
pod 'Tabman'
pod 'RSSelectionMenu'
pod 'Pushbots'
pod 'ACProgressHUD-Swift', '~> 1.4'
pod 'SKPhotoBrowser'
pod 'ZoomableImageSlider'
pod 'RSSelectionMenu'
pod 'DropDown'
pod 'ImagePicker'
end
I updated platform :ios, '10.0' to 11.0 and the error disappeared. Change your platform or OS version and check. Hope that could help.
Specify your pod's version for example pod 'RealmSwift', '~> 5.3.5'
or uncomment # platform :ios, '9.0' in your Podfile
I faced this issue on Xcode 14. Add this on podfile bottom.
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
# some older pods don't support some architectures, anything over iOS 11 resolves that
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
end
end
end

Issue with import Parse - No such module Parse

I installed the Parse iOS SDK with Cocoapod and wanted to import it in my appDelegate.
But I have the error No such module Parse even if I try to clean the build. Also I have a lot of warning coming from Parse AND Bolt (a dependency).
I downgrade the package from the current 1.15.3 (at the time of this writing) to 1.14.4 but have the same trouble.
here my Podfile
# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
target 'BookBank' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for BookBank
pod 'Parse'
end
Any idea ?
Edit
I think I found out why. Even opening the *.xcworkspace file XCode didn't seem to link with the Cocoapod libraries. I try with Alamofire or other well known package and I had the same issue. So it was pointing out it wasn't a library problem.
I google for a day (and lost a day of working) and I solve my issue.
I had to change the scheme of the app like so
Click on the upper-left of XCode on your app's name
Then Manage Schemes
And finally change your app container to the one with the workplace.
Clean the build et voilà !

Parse SDK / CocoaPods

I have an objective C iOS app using the Parse SDK.
In the process of moving this app from Parse.com to a self hosted Parse-Server, I need to update the Parse SDK to the latest version. For this update I decided to go with CocoaPods.
This is the first time I touch CocoaPods (after reading and hearing so much good about it).
I found my way, following what I could read here and also based on a few CocoaPods tutorial I quickly viewed.
Having my project "ready", when buiding it I get this error:
#import <ParseUI/ParseUI.h> -----> File not found.
Obviously things have changed place. And I tried a couple of unsuccessful solutions.
So here is my question:
How do I need to change the settings of my project, now that I am using CocoaPods?
In order to use Cocoapods with parse and Parse UI you need to do the following steps:
Create a new file and name it Podfile. This file should be located on your IOS project root folder.
The Podfile should contain at least the following structure if you want to use parse IOS SDK and ParseUI
platform :ios, '8.0'
use_frameworks!
pod 'Parse'
pod 'ParseUI'
# Put more pods in here..
Notice to the platform, you may change it to the minimum version that your app can run on and the use_frameworks! will install all your pod as frameworks and this is mandatory if you like to consume Swift libraries.
Open terminal and navigate to your IOS root directory and enter pod install. This command will install all the pods and dependencies into your project.
After installing you will no longer use the IOS project file from now on you will use a new file which called workspace. The workspace will contain both your project files and the pods project/frameworks files.
Build your project, fix some error (if there are) and run it to make sure that it works as expected .
More CocoaPods commands that you need to know are:
pod update - update all your pods to the latest release or to the release that was mentioned in the Podfile
pod update update specific pod to the latest release or to the release that was mentioned in the Podfile
pod outdated - display out to date pods that are being used inside your project.

Alamofire not available after pod install

I am trying to use Alamofire in a swift file that is part of a hybrid (Obj-c/Swift) application. I added a reference to my pod file and ran 'pod install'
When I try to import Alamofire into my Swift file, I get a compile error and Alamofire is not in code completion. Here is my pod file:
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
# Uncomment this line if you're using Swift
use_frameworks!
target 'TheProjectName' do
pod 'Alamofire', '~> 3.4'
end
When I return to my Swift file, I should be able to add the following statement:
import Alamofire
but I cannot because Alamofire is not found. The message is
no such module 'Alamofire'
I have verified that Alamofire is in my pods directory and appears to have been installed correctly. There are no error messages of any kind when running 'pod install'
Any ideas or suggestions of how to solve this? Thanks!
Build your project before you attempt to import after pods install.
Every time I cloned a working project that integrated with Alamofire (from CocoaPods) I encounter this same "unhooked" framework compiler error. I would perform various actions: uninstall / reinstall, open/close; close Xcode - deintegrate - delete files - install - update - open Xcode - clean, build for "generic" - build for simulator, etc. as suggested. Never quite certain if it was going to fix the issue, but eventually it might. Tonight, it was exceptionally stubborn and this is what I truly believe fixed it ...
In Xcode,
locate the file Alamofire.swift in the Project Navigator
delete the file from Alamofire folder under the framework (remove reference, do NOT toss in the trash)
add new file (right click on Alamofire folder) and navigate to find the Alamofire.swift file
Build-to-run on Simulator (my case I used iPhone 12) and voila it compiled successfully.

Xcode 7 Cannot load underlying module for AlamoFire 3.x (CocoaPods)

I use Alamofire 3.3 with Xcode 7.1.1, installed with Cocoapods
and I have this problem a couple of time :
Cannot load underlying module for Alamofire
here it's my Podfile :
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
target 'MyProject' do
pod 'Alamofire', '~> 3.0'
end
I heard about the same problem with Xcode 6.3 and it helped me to
solve the problem once by cleaning project, but this time, I tryed to
Clean Project
Clean Xcode derived data and cache
update with version 3.1 3.2 and 3.3 of Alamofire
List item
... and nothing seams to work
does someone have the same troubles ? or any solution ?
I'm not sure if this will solve it for you but usually this occurs when you are trying to include a framework that hasn't been built yet.
Have you tried Product -> Build yet?
I think it is small bug on cocoapods install
Please try again after clean and build
if still not working, turn off xcode and try again
it worked on my side
I had the same problem,uninstall pod & install again . It worked for me , hope this will be useful for others.
For Xcode 9:
Once you have installed Alamofire pod.
Step.1 you should open your project by double click on your_project_name.xcworkspace file.
Step.2 Go to project settings --> Build Phases --> Link Binary with Libraries --> Add framework "Alamofire.framework"
Thats it!!
Now you can import the module
Kill Xcode and do pod update. Open Xcode, clean and build. This should fix it.

Resources