Xcode version problems. error:using bridging headers with module interfaces is unsupported Command CompileSwiftSources failed with a nonzero exit code - objective-c

my iPhone just upgraded and now my iOS version is 15.3.1. Since my old version(12.4) of Xcode doesn't support that version of OS, I've installed newer version of Xcode(13.2.1). Now I cannot run my project and I got this error. I've changed Build Libraries for Distribution to NO and than my build is successful but when I set up breakpoint and start debagging I'm losing connection with debugger on my iPhone. Also I put device file(15.0) in /Aplications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport and in Supporting Files but it didn't
help. I will appreciate any help. Best regards.

Open your XCode,
Go to the Runner under PROJECTS -> search for 'distribution'
Make "Build Libraries for Distribution" to NO (if it is YES, change it to NO).
Do the same for Runner under TARGETS.
I also had the same problem I resolved it in this way.
Update:
Also don't forget to uncomment the following in iOS -> Podfile
platform :ios, '11.0'

Related

Bitcode signature failure in Xcode

I updated Xcode to the last version, and now when I'm trying to compile the project I'm getting an error "Invalid bitcode signature", hovewer, the bitcode for my project is disabled. How can I fix it? What should I change to sign my bitcode correctly?
My Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
target 'MyProjectName' do
pod 'Realm'
pod 'CorePlot'
pod 'GoogleMaps'
end
I checked already, everything is fine with it.
I'm not sure if you have the same situation with me. I only have this issue when I tried to test with iPhone device. It turns out that the debug configuration with Build Active Architecture Only is set to NO. After I set to YES, I can test with my iPhone.
I experienced this error, but it happened only when building for an iOS 10.3 iPad (despite working on an iOS 10.3 iPhone and an iOS 11.0 iPad, and all the iOS 10.3 and 11.0 simulators). Through painful process of elimination (and creating a new project from scratch), I found that my Cocoapods weren't at fault, nor was my code signing settings, nor my AppExtension, nor my tests, nor my 'build for active architecture only' setting, nor any build setting related to the term 'bitcode'.
In my setup, I had a C++ Xcode project nested within my main Swift/iOS Xcode project. Because it was never intended specifically for use in iOS, the "iOS Deployment target" had never been set (it was left on 'default'). Upon setting it explicitly to 10.3, it worked without complaint.
Nested C++ app's project settings (set iOS deployment target to the lowest iOS version you support):
Nested C++ app's target settings (for reference):
If you using pod then please check the version of all libraries, some library may be not supporting in new version , you have to update pod files for that library.
In my case, I was trying to build for a device with an iOS version lower than the deployment target.
This kind of problem came up when I linked a new static library project to my workspace. In order to solve it I tried to set both the Build Active Architecture Only and the Bitcode settings of the library to NO but no luck. Then I got across the thing that the library's Deployment Target was set to 11.0 as Xcode set the latest value to all new projects. After fixing the setting to 5.0 the problem was solved.
On my case problem occured because of I was using a 3rd party static library with different files for each architecture
I fixed the problem by removing binaries of invalid architectures.
Instead I added a multi-arch FAT binary for the 3rd party static library
Hope helps
For my case, the solution was removing a c++ library.
I found that my issue was with using 'Modules'.
Just turned off modules (had to update some header files), but that resolved my issue.
Enable Modules In Settings
In my case, the widget included in the project was causing the bitcode error.
I changed my pod file from this:
target "App" do
pod 'A'
pod 'B'
end
target "App Widget" do
pod 'A'
end
to this:
target "App" do
pod 'A'
pod 'B'
target "App Widget" do
pod 'A'
end
end
To fix this issue, most answers recommend a workaround whereby you clean your Xcode workspace/project, close Xcode, delete your Derived Data folder (this is kept in the root directory of your project by default), then finally re-open your project.
However, the above steps may not work for you. This is a hint that your project structure is in error.
When the bitcode intermediary representation of your project was released with iOS 9.0, it was done so on the provision that your entire project, including dependencies, either totally agree to use bitcode or not. From my experience, it is vital to work through all of your Pods and included Libraries/Frameworks and ensure they all use the same setting; either Yes or No. By default, this selection is Yes.
If a single dependency does not match the intended bitcode setting, this error can be thrown.
When sanity checking your dependencies and overarching project, it is important to note that there is a Use Bitcode setting for both the Project and the Target settings, so be sure to check both perspectives of the Build Settings.
I was adding static library . I created fat binary of the same library including all architectures and included in my project. This resolved my issue
In my case, I am Using Cordova Project. While building it with Xcode had the same issue and Resolved by Removing and Adding the IOS platform.
cordova platform remove ios
cordova platform add ios
If you are using cocoa pods then do "pod update"
Targets -> Build Settings ->Build Active Architecture Only
Debug -> YES
Release -> NO to YES
I face the same problem only on archiving the app.
Who can tell me the reason? You can teach all developers. It's awesome.
This solution work for me. First, try to remove all pod using terminal command pod deintegrate and then reinstall pod using terminal command pod install.
This can also occur when building for the simulator if including a framework built for ARM only (and I assume vice-versa as well).

Architecture linking error after Xcode 5.1 upgrade

I am having these errors:
libGPUImage.a, file was built for archive which is not the architecture being linked (armv7s),
libPods.a, file was built for archive which is not the architecture being linked (armv7s)
and more...
These are my project settings:
Architectures:armv7,armv7s,arm64
Build Active Architectures Only:NO
Valid Architectures;armv6 armv7 armv7s arm64 i386
I didn't change anything except for downloading latest Xcode 5.1 with the iOS 7.1 SDK. This project worked fine with Xcode 5.0 and iOS 7.0 SDK. What could be the problem?
Got to Build Settings -> Architectures
You probably have Standard Architectures set, right?
As of Xcode 5.1 Standard Architectures includes arm64, which you are not ready to support.
Select Other..
doubleclick $(ARCHS_STANDARD) and change it to $(ARCHS_STANDARD_32_BIT)
Note: This is a temporary fix. You are probably using some static library that didn't come with a 64-bit slice. See if there is one available and then switch Architecture back to Standard Architectures.
I had a bunch of similar issues upgrading to Xcode 5.1. I resolved them by first updating CocoaPods:
gem update cocoapods
Then updating the pods in my project:
pod update
In my case, there was some corrupted stuff in my ~/.cocoapods directory which was causing pod to throw errors. Deleting everything in ~/.cocoapods then running pod update again got things working again.
We had this same thing happen to us, the problem is "Standard Architectures" under "Architectures" used to be armv7, armv7s, in Xcode 5.1 Apple changed "Standard Architectures" to be armv7, armv7s, arm64 so now you have to manually enter your own architectures instead of picking "Standard".
Open in some text editor (for instance SublimeText) your ./Pods/Pods.xcodeproj/project.pbxproj file. Usually with the following command in the terminal (keep in mine you have to be in your project directory) st ./Pods/Pods.xcodeproj/project.pbxproj and find and replace ONLY_ACTIVE_ARCH = YES with ONLY_ACTIVE_ARCH = NO. Also you can do the same with your {YOUR_PROJECT}.xcodeproj/project.pbxproj. And last Clean and Run from the Xcode!
In my case, it was fixed by changing _view to self.view.

No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=i386)

While using the iphone simulator 64 bit, i'm getting the following architecture error. Also using the xcode 5.0. Any suggestions.
have a look under your build settings, check that the setting Build Active Architecture Only is set to No (might make compiling a bit slower but should fix the problem)
Also check that the Valid Architectures has arm64 in the list
Note if you are getting an error when submitting an app saying "Apps that include an arm64 architecture are required to include both armv7 and armv7s architectures”, setting it to No will also fix this
What you need to do is just set the ONLY_ACTIVE_ARCH to NO. Hope it will work.
if you getting error on test xcode project then delete it also resolved this problem.
other way is todo
I had the same error message after upgrading to XCode 5.1. Are you using CocoaPods? If so, this should fix the problem:
Delete the "Pods" project from the workspace in the left pane of Xcode and close Xcode.
Run "pod install" from the command line to recreate the "Pods" project.
Re-open Xcode and make sure "Build Active Architecture Only" is set to "No" in the build settings of both the "Pods" project and your own project.
Clean and build.

CocoaPods : cmd-line builds

It seems that in cmd-line builds, Pods don't get built automatically. Even when invoking xcodebuild to reference the workspace that declares how projects link to each other.
Is there a way to fix this, besides manually opening the project in Xcode and building?
I don't have any problem with such configuration: CocoaPods 0.28.0 and Xcode5 (+ Command-Line Tools) here and building using the Command-Line quite often (especially for Continuous Integration) without having any problem.
Neither with the Apple's xcodebuild command, nor with xctool (see also this NSHipster's article) when building my personnal project using Travis-CI either, everything works fine;
At work we have plenty of Xcode workspaces created using CocoaPods / pod install and we use Jenkins-CI to run xcodebuild to build them and no problem either.
Maybe you need to check a bit more about your configuration? Which CocoaPods & Xcode version, Which Command-Line Tools (xcode-select --print-path?), How is you Xcode configured (maybe you changed some of Xcode's default settings that broke it somehow)?
Tell us more about your specific configuration and the error/warning messages you got, because there should not be any problem.
Also make sure you have an up-to-date version of CocoaPods (some stuff were fixed some versions ago regarding Xcode5 and the new arm64 architecture, that broke implicit dependency detection in some cases)

RestKit.h Not Found When Building With Xcode Product > Profile

I have an app that uses RestKit 0.10.2 and I can build and run the app just fine in the Xcode 4.4.1 simulator using iOS 5.1.1. I can also run Analyze without any issues. However, when I go to try and Profile the app, the build fails with Lexical or Preprocessor Issue RestKit/Reskit.h file not found.
Here's what I have in Header Search Paths > Debug on the target:
$(BUILT_PRODUCTS_DIR)/../three20
$(BUILT_PRODUCTS_DIR)/../../three20
"$(BUILT_PRODUCTS_DIR)/../../Headers"
What could I be missing? When I upgraded from 0.94 to 0.10.2 I completely removed Restkit from my project and re-imported it because I was having a lot of issues trying to get this exact same problem resolved for a normal run. Any ideas?
Profile uses a Release build by default, not Debug (since it makes no sense to profile a debug build). Make sure Header Search Path -> Release is also filled in.