Swift project with cocoapods new errors when watchkit added - ios

I have a working Swift IOS project that uses an Objective C SDK. The SDK code is installed and updated with cocoapods. There is a bridging header file in the Swift project. This project has been compiled and run many times, and is fully operational. And of course, since it has been built and run, the workspace file is how it is opened...
I added a watchkit extension to it. I ran pod update to make a new lock file. I confirmed the search path in the watchkit includes the pods/recursive. I added the header file to Watchkit Extension.
Those three steps are the only suggestions I've been able to find regarding making cocoapods managed code work with Watchkit.
I get three errors. they are:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_SparkCloud", referenced from:
__TMaCSo10SparkCloud in InterfaceController.o
"_OBJC_CLASS_$_SparkDevice", referenced from:
__TMaCSo11SparkDevice in InterfaceController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Does anyone have a suggestion for further steps that may allow the project to compile?

As mentioned in the question, this Swift IOS project uses cocoapods to manage an objective C SDK that provides access to a Cloud API.
Take these steps after adding the WatchKit Extension to the Xcode project.
In the project main folder (blue, top) Info tab, note that in the section Debug,there is an entry of None beside the WatchKit Extension. Change this to Pods.debug. Click on it and choose Pods.debug.
Under the Release section, change the WatchKit Extension from None to Pods.release
Now click on the WatchKit Extension Target and choose the General tab. Here the Linked Frameworks and Libraries will be empty. Click the plus sign and choose from the list libPods.a and add it, make sure the Required option (to the right) is selected.
That should finish the job of getting your cocoapods library accessible to the InterfaceController.swift file under WatchKit Extension, which is where you write the code that "runs" the watch.

It looks like you are missing the SparkCloud.framework in your project. You can add it by:
Clicking on your project in the upper left of the left pane (the blue icon).
Navigate to "Build phases."
Under "Link Binary With Libraries", click on the plus button.
Find the SparkCloud.framework from the list and hit Add. You may also want to add any other frameworks that are required for the Spark SDK.
This will ensure that the Spark frameworks are found by the linker.
Click build, and the error should go away.

Related

SIGABRT error loading app to iPhone after successful build and past successful deployment

I built an iOS app using Xcode 9 and deployed successfully onto iPhone X running iOS 11.4, but since updating iPhone to iOS 12 and Xcode updated to 10 my app builds successfully but then I get a SIGABRT error stating:
dyld: Library not loaded: #rpath/libswiftAVFoundation.dylib
Referenced from: /private/var/containers/Bundle/Application/3C7010B7-BC26-4638-AEAF-E3F45108826C/PaintingPortal.app/Frameworks/OmniVirtSDK.framework/OmniVirtSDK
Reason: image not found.(lldb)
I've done the following to try and resolve this:
I checked that OmniVirtSDK.framework is listed in frameworks folder.
I added to Runpath Search Paths to include $(inherited) and #executable_path/Frameworks.
I checked OmniVirtSDK.framework is listed in Embedded Binaries.
I checked OmniVirtSDK.framework is listed in Linked Frameworks and Libraries.
(I removed and added both of these to be sure they were valid attributes).
I re-ran clean and build several times.
I deleted the DerivedData folder, then clean and build as well.
I ensured AVFoundation.framework was listed above OmniVirtSDK.framework in the frameworks list and also in the Linked Frameworks and Libraries lists, in case order was relevant.
I ensured "Other Code Signing Flags" under Signing was blank.
I ensured "Other Linker Flags" under Linking included '_ObjC'.
I ensured "Strip Swift Symbols" under Deployment was set to 'No'.
All of these were the advice on any related forum entries that I could find, so I now need help to understand what to do to resolve the issue and obtain a successful app launch on my test device.

React native facebook login in ios undefined symbols for architechture x864

I'm trying to add facebook login on react native latest version 0.49 by follow this tutorial
https://github.com/facebook/react-native-fbsdk
I did step by step and see some videos on youtube and did exactly but I still get the same 28 errors
I guess maybe it's because in the link Binary with Libraries I can't see the FBSDK, even I added it as explained on tutorial to Frameworks folder
I saw some posts in stack overflow e.g
React Native iOS build failed : Undefined symbols for architecture x86_64
but without any help.
thanks.
There is an issue with XCode 9, where when you drag and drop any files, it does not get added to the target.
You need to manually add them to your target in File inspector now.
This can happen not only with frameworks but other files as well. To prevent this issue, whenever you want to add any file or resource to your XCode project, you should first add that file/resource to the project folder and then right-click and then add to your XCode project using Add Files to ..

Carthage image not found Xcode 7 Carthage 0.8.0

Currently I'm using Carthage Dependency manager, and Everything works fine. Until I Run the code on my simulator. I get the following error message.
dyld: Library not loaded: #rpath/OAuthSwift.framework/OAuthSwift
Referenced from: /Users/eddwinpaz/Library/Developer/CoreSimulator/Devices/117C3ED9-5B0A-4FCD-B231-5E9BC0ADF821/data/Containers/Bundle/Application/1FC4FA99-7479-44D1-BB71-1A52404BDB4C/App.app/App
Reason: image not found
(lldb)
I've followed the steps on the following tutorial.
http://www.raywenderlich.com/109330/carthage-tutorial-getting-started
I must also mention that I installed manually the Carthage.pgk of Carthage and then removed it and install it via Brew.
There is something I'm forgetting to do?
There can be multiple causes. One cause can be that the framework is being linked with the framework but the framework is not being embedded in the app bundle. The compiler will happily link it for you but the dynamic loader will not find the framework’s image (i.e., binary) at launch.
To resolve this issue, select the project in the Project Navigator, select the app target in the list of targets, select the “Build Phases” tab, and add the framework in the “Embed Frameworks” list. If the framework is already in the list, the problem lies elsewhere.

ios - moving frameworks broke the project

I recently added the Social.framework and Accounts.framework to my ios project. It was placed on top of the navigator area and I dragged those two into the frameworks folder. Then it showed in red color in the Build Phases "Link Binary with Libraries" ....and now the project crashes on startup.
What did I do so wrong? And what is the correct way to fix this?
I get this error:
dyld: Library not loaded: /System/Library/Frameworks/Social.framework/Social
Referenced from: /Users/owner12/Library/Application Support/iPhone Simulator/5.1/Applications/823A0485-7443-4206-B9F5-A84C03DBFB89/BusinessPlan.app/BusinessPlan
Reason: image not found
You didn't do anything wrong. Sometimes Xcode gets confused. I would suggest that you edit the project, scroll down to where it lists the frameworks, and select the Social and Accounts frameworks and click the Minus button.
After that, you might want to quit Xcode and clean out the build folder as described here:
How to Empty Caches and Clean All Targets Xcode 4
If that doesn't solve it, you might have to revert to an earlier commit.

Could not instantiate class named MKMapView

I may be doing something really stupid here as I've done it before and it worked and now...
Created a new iPad project, in the details view I added a MKMapView, added the MapKit.framework to the project, added the property / etc. to the header. Go to run the project and get a SIGABRT with
****Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate
class named MKMapView'**
I found http://mithin.in/2009/06/22/using-iphone-sdk-mapkit-framework-a-tutorial/ but, like I said, I've already added framework. What am I missing?
I ran into this too, but I was able to get past it by following the instructions of step 2 in your link (thanks, by the way):
Add the MapKit framework to the project. (Control + Click Frameworks
folder -> Add -> Existing Frameworks)
I just searched for MapKit.framework, added it to the project, and the error went away.
I haven't added any map code yet (although I do have a MapViewDelegate connected in IB), but it's working fine so far!
Click on your project to bring the project settings. Under Targets, click your project, select from the upper toolbar "Build Phases". Under "Link binary With Libraries" tab, you will see the list of frameworks included in your project. Click the "+" button and add MapKit library from the shown list to your project.
For Xcode 6.1:
Select your project
In general tab, look for Linked Frameworks and Libraries (last one)
Press + button
Search MapKit.framework
Finally add
Easy way!
Works above Xcode version 7.2
As far as I'm concerned selecting the MAPS from capabilities will automatically link your framework to your project all you have to do is check the Maps button in Capabilities -> Maps.
Heres the attached screenshot. Cheers!!
For xCode 4.2:
Click on your project name ->targets ->building Phase ->link binary with library
-> click on + sign ->select mapKit.framework ->click add
I noticed that I was getting this message (on top of the original one mentioned in this post) when I was building and running on the simulator:
ld: warning: ignoring file
/Users/peter/programming/iPhone/iNspector/MapKit.framework/MapKit,
file was built for unsupported file format which is not the
architecture being linked (i386)
Then I just connected my iPhone, build and ran on the device, and the map worked.
So it seems that the MapKit framework cannot be compiled on the 386 architecture, it needs the device.
In regards to #futureshocked's input, I also came across the
Id: warning: ignoring file /blah.../MapKit, file was built for unsupported file format which is not the architecture being linked (i386)
issue.
**Check to make sure you didn't copy the MapKit framework into your local project directory when you added it to your project. I accidentally did this and XCode was giving me the above error. So I removed it from my project directory (in Finder), recompiled, and everything was normal again.
If you don't have the Framework in your project, go ahead and re-link as stated in the answer above.
Found a good tutorial on getting started with MapKit:
http://www.youtube.com/watch?v=X-3jM24EIGM&feature=related
I also received this error when trying to deploy to my 5.1 phone (with XC 4.5), even after changing my deployment target to be 5.1. Looks like the maps update wouldn't fly since I still had Google Maps on my phone. After updating my phone's OS, the exception disappeared.
Please import the WebKit at your Build Phases.

Resources