Resource-Target of pod erroneously needing Swift Version set - ios

After successfully linting and updating a pod, I updated it in the main project. However, upon cleaning I encountered this issue:
Normally this is simple to resolve (go to Build Settings and set the Swift Language Version -- however, this error is occurring on the Resource-Target, which doesn't have that setting...making it very strange that I am running into this error.

I've figured out how to resolve this.
The Resource-Target includes a xcdatamodel. I needed to change the Code Generation to Objective-C rather than Swift. This was hard to find especially since the pod lint step did not catch this or give any warning.
I found this answer via: https://github.com/CocoaPods/CocoaPods/issues/7950 -- even though this issue doesn't seem to be exactly the same as this one, but it is related.

Related

Xcode12 po command in lldb in console cannot find variables in scope

Ever since I updated to Xcode 12, I have not been able to print out variables in the console while debugging with lldb.
Using print() statements directly in Swift code outputs to the console as expected.
A command in the console such as po "hi" outputs "hi" to the console as expected.
Trying to run po <variable_name>, instead, always outputs this line:
error: <EXPR>:3:1: error: cannot find 'variable_name' in scope
instead of the expected variable's value.
Steps I took
Add these lines to Swift code
let example = "hi"
print(example)
Put a breakpoint on the second line, the one with the print() statement
Run the code and wait for the breakpoint to be hit
Try to run po example in the debug console
Expected result
It should print "hi" in the console
Actual result
It prints this error line
error: <EXPR>:3:1: error: cannot find 'example' in scope
It's the same when running on the simulator or a device. I've tried activating the console, and restarting Xcode.
I've tried creating a new project in Xcode12 and that works fine, my other older projects created with previous versions of Xcode work fine in Xcode 12.
I've tried confronting the Build settings both with the other projects and with a newly created project and it seems nothing's wrong: optimization is set to None as it should for debug build configurations and the run scheme is set to launch a debug build configuration.
Where else could the problem be?
I had this issue as well, everything was set correctly in build settings, I had the same situation as in the question.
For me the problem was solved after I moved all my SPM dependencies back to CocoaPods, but that's not the silver bullet because I have other projects where some dependencies are on CocoaPods and some on SPM and those work perfectly fine.
What can be useful, though, is that to come to this solution I checked out older commits until I found a working one and then tried to restore things that changed since that commit. This should help find the cause in every specific case.
This issue is so unpredictable that, if you are experiencing it, I think it's worth filing a feedback to Apple, if you can, attaching your projects to the feedbacks.
You can change optimization level to "none" value in build settings. Its works for me.
In my case the problem was caused by 'GoogleAPIClientForREST' installed as Cocoapod dependency in a project containing also a Swift Package.
You can find the issue reported here: https://github.com/google/google-api-objectivec-client-for-rest/issues/478
I don't know if the responsible for the problem is SPM or GoogleAPIClientForREST, but a good workaround for now is to install a previous version of GoogleAPIClientForREST:
pod 'GoogleAPIClientForREST/Drive', '~> 1.3.11'
pod 'GoogleAPIClientForREST/Calendar', '~> 1.3.11'

Apple Mach-O Linker Warning after xCode Update [duplicate]

I have a slight issue when build my Xcode project, get tones of warning after update pod. It looks like this
Already search the whole site here but still no luck. it doesn't affect the project but it is quite annoying. Anyone could help?
It probably means their binary file has non-aligned pointer when they compile their code. In those cases the alignment basically defaults to 1 byte and hypothetically might impact performance.
After updating to Xcode 8.3 public release I am still seeing this error, so Google might need to compile their static library with different settings to make it go away.
Got this response from firebase support:
This is a known issue with Xcode 8.3 beta, so it might be a beta thing
and Xcode being extra verbose. It works well though with 8.2.1 so I
recommend temporarily use it to avoid the warnings or ignore the
warnings on 8.3 beta if it does not affect your app.
This has been fixed in Firebase 3.16.0 (Firebase Core 3.6 + Firebase Analytics 3.8.0)
guys, it is all fixed now. Tested it all myself on two projects. You got to go to the correct directory of your project so that your pod spec file is visible to your command line commands, run
pod update
and see it all fixed and working properly!
These problems are addressed, and likely fixed, with release 3.16.0.

How to remove the Xcode warning Apple Mach-O Linker Warning 'Pointer not aligned at address

I have a slight issue when build my Xcode project, get tones of warning after update pod. It looks like this
Already search the whole site here but still no luck. it doesn't affect the project but it is quite annoying. Anyone could help?
It probably means their binary file has non-aligned pointer when they compile their code. In those cases the alignment basically defaults to 1 byte and hypothetically might impact performance.
After updating to Xcode 8.3 public release I am still seeing this error, so Google might need to compile their static library with different settings to make it go away.
Got this response from firebase support:
This is a known issue with Xcode 8.3 beta, so it might be a beta thing
and Xcode being extra verbose. It works well though with 8.2.1 so I
recommend temporarily use it to avoid the warnings or ignore the
warnings on 8.3 beta if it does not affect your app.
This has been fixed in Firebase 3.16.0 (Firebase Core 3.6 + Firebase Analytics 3.8.0)
guys, it is all fixed now. Tested it all myself on two projects. You got to go to the correct directory of your project so that your pod spec file is visible to your command line commands, run
pod update
and see it all fixed and working properly!
These problems are addressed, and likely fixed, with release 3.16.0.

Run custom shell script '[cp] embed pods frameworks' no such file or directory

Just finished resolving my errors after converting to Swift 3 only to get this error when trying to compile. I have attached a screenshot for clarity, it does not look like the system is looking for a .app file or .sh file. Really don't know too much about the Pods, so any help would be greatly appreciated!
Seem to have found a solution. My project name had a space in the middle of two words, very bad practice I know. Not entirely sure what caused this error, though one could possibly conclude that since the problem originated in the Pods framework, it could be related to Cocoapods, rather than migration to Swift 3.
I traced the problem to the Pods framework for my project after searching extensively for solutions to this problem.
Fixed the double quotes to single quotes on the line highlighted, and the project built instantly. Hope this helps anyone else having a similar issue!
• Just restart your system..... It Looks crazy but my problem solved.
Swift4/5 Xcode10 Same Issue...
After upgrade cocoapods, reset pods, clean the build folder...., all these tries, it still fails... until I found this post.
However, there's no space in my project name, but do have a special characrter <'> in it. I decided to give it a try to see if it is the source of issues. After following along the instructions in how-do-i-completely-rename-an-xcode-projec, the project builds successfully, finally.
So just a note: avoid using space or other special characters in the project name, that may cause some unexpected errors

Reference to xml_****_**** is ambiguous

I have updated my Xcode to the latest version of 8.0
After the update, I am facing a new build error preventing me to run the project on the simulator.
The error is the below in DDXMLNode.m:
reference to 'XML_DOCUMENT_NODE' is ambiguous
I am using the XMPP framework as pods (pod 'XMPPFramework') so I still can't figure out a way to solve this.
Note that the project is working normally on the device and was working on both Device and Simulator with the previous Xcode Version.
I have tried to search the internet but I still didn't find any solution for this.
I tried to clean the project and delete everything in the DerivedData folder as well, but it didn't solve the issue.
Appreciate any help.
Actually I am posting this answer in case it may help someone in the future.
After searching a lot without finding any answer, I discovered the following:
There is a file called module.modulemap that contains 2 methods.
module libxml [system] {
header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/libxml2/libxml/tree.h"
export *
}
module libxmlSimu [system] {
header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/libxml2/libxml/tree.h"
export *
}
The first one is used for real devices, the other one for the simulator.
However, when building the app on the simulator, and for a reason that I didnt figure it out, tree.h is being duplicated and causing all these issue.
So what I made to be able to run the project on the simulator was to comment the first method so the app can build successfully.
NB: Don't forget to uncomment the method once you want to run the project again on the real device.
Hope this will help anyone who will face the same issue.
i have tried some way.
I search the word XML_DOCUMENT_NODE with a result here:
then replace every error with the left symbol. It turns out to be OK for me now.

Resources