Xcode 13 Swift project - Archive build giving me error on Objective C Bridge - swift

I have a Swift project running on Xcode 13. The project builds perfect without any error, but when I try to Archive then I get error that is related to the Objective-c Bridge.
I have the my .h bridge file created correctly. That's why when I build it works perfect. This is only happening when I want to Archive for a publish.
This is the content of my .h bridge file:
#ifndef TestApp_TestApp_Bridging_Header_h
#define TestApp_TestApp_Bridging_Header_h
#import "ECSlidingViewController.h"
#import "DSLCalendarView.h"
#import "UINavigationController+Orientation.h"
#endif
I also have under my Target - Build Settings, the reference to the Bridge file:
Any clue what can I could try. I need this to get ready for publish.

You also need to set the bridging header path in the release section as well.

Related

Why is Xcode 6.1 using paths from an old folder?

I downloaded an Apple Objective-C sample app on my Macbook, and it was placed into the Downloads folder. I unzipped and moved the folder into Documents and am trying to do a mix-and-match conversion to Swift. I've migrated one of the classes to Swift and am trying to build, but it's failing with this error:
<unknown>:0: error: bridging header '/Users/alan/Downloads/examples/MyTest_ios/Classes/MyTest_ios-Bridging-Header.h' does not exist
because the compile command is using paths pointing to Downloads, specifically for the bridging header file:
-import-objc-header /Users/alan/Downloads/examples/MyTest_ios/Classes/MyTest_ios-Bridging-Header.h
The project's Build Settings for the Swift Compiler - Code Generation setting for Objective-C Bridging Header is set to:
Classes/MyTest_ios-Bridging-Header.h
The properties for the bridging header file are:
Type: Default - C Header
Location: Relative to Group
Full Path: /Users/alan/Documents/MyTest_ios/Classes/MyTest_ios-Bridging-Header.h
I've scoured the Build Settings paths and everything looks fine, what am I missing?
UPDATE
I modified the Objective-C Bridging Header value to be the full path instead of relative to the Classes sub-folder, and now the compile gets past that error. I still would like to know why Xcode was using the old folder's path... a bug in 6.1?

I am looking to implement Platinum UPnP in iPhone

I want to implement Platinum UPnP for my iPhone Project, but the SDK does not really provide the proper documentation to help.
I tried to follow the below line as per read me file -
MacOSX, iOS:
Open the XCode project file located # Platinum/Build/Targets/universal-apple-macosx/Platinum.xcodeproj
To include Platinum to your XCode projects, simply add the project file then add Platinum as a Target Dependency as well as libPlatinum.lib in Link Binaries.
Alternatively, you can build the Platinum.Framework using the PlatinumFramework target and add it to your project.
But ended up with this error:
clang: error: no such file or directory:
'/Users/ankit.nigam/Library/Developer/Xcode/DerivedData/PlatinumDemo-gahtotovpnfcvyddmpiwgntarctu/Build/Products/Debug-iphoneos/Platinum/Platinum'
Any idea what I'm doing wrong?
I figured it out what was the problem with the - I was to add the Platinum.framework to link binary and add the framework to header search path.
first u must build a release version Platinum.frmework(i386,86,64,armv7),must release version.
and then.pull it and Neptune.frmework in your project.
at last, this is a C++ framework, so you must change .m to .mm where you use is in your file.

ZXingWidget: Counted.h file not found

I am building an iPhone app using ZXingWidget. I followed the README instructions and got everything setup in my project and it compiled with no problem. I then imported QRCodeReader.h in my view controller header file and started to get the following error on compilation of FormatReader.h:
Lexical or Preprocessor issue 'zxing/common/Counted.h' file not found.
I realized I had forgotten to rename my view controller implementation file from .m to .mm so I did that. However, I am still getting the error.
Any suggestions?
EDIT: Here is the directory layout for my "QR Scan" project. You will see that "cpp" is under the "Projects" folder and that "QR Scan.xcodeproj" is in the "QR Scan" folder. I have "../cpp/core/src" in my headers for my QR Scan Xcode project.
/Projects
/cpp
/core
/src
/QR Scan
/QR Scan
/ZXingWidget
ZXingWidget.xcodeproj
QR Scan.xcodeproj
Double check step 5 of the README. You don't have the C++ header files in your include path.
I had to spend lot of time fixing this problem. Even after change the file extension to .mm, the problem still showed up. The problem was because of the import statement. Try placing the #import "ZXingWidgetController.h" in your .h (header file) and #import "QRCodeReader.h" in your .m(implementation file). This really solved my problem in XCode 4.2. hope this helps someone.

#include<vector> no such file or directory

So I need to use vectors in my project. I have changed the .m file to .mm to make it Objective-C++. But, when I try saying:
#include <vector>
In my .h it says the file or directory can not be found. If I put that line of code though in my .mm file though the error doesn't appear, but since I need a vector in the #interface (which is in my .h) what should I do to make the .h file find the vector file?
Also, I have tried changing it to compiling everything as Objective-C++, but that doesn't work because I get some errors in the Cocos2d library I am using...
Is your .h file being included in any OTHER .h or .m files?
If so, you'll have to make those (or files including them, etc) into .mm as well.
Without changing any .m to .mm or anything like that, if you click your project, click tagets->build settings go all the way down to "LLVM GCC 4.2 - Languages" you will see Compile Sources As change that value to Objective-C++;
I was unable to upgrade to Xcode 11.1, so I trashed Xcode 11.0, then downloaded Xcode 11.1. Xcode 11.1 worked until I rebooted where I got the above message on the default "hello world" command line C++ program.
My solution was to:
quit Xcode,
empty the trash,
launch Xcode

.dylib linked in Debug, not found for Release for iPhone in XCode

So I have included the libxml2.2.dylib library into my iPhone XCode project to create some Xml and XPath parsing utilities. When I compile and run in Debug mode for both the Simulator and Device I have no problems, however, When I switch to Release mode I get...
"error: libxml/tree.h: No such File or directory" as well as other similar errors for the following .h files.
#import <libxml/tree.h>
#import <libxml/parser.h>
#import <libxml/HTMLparser.h>
#import <libxml/xpath.h>
#import <libxml/xpathInternals.h>
What do I need to do to ensure the libary is included and linked to the Release build?
An error on the .h is a compile-time error with your Header Search Paths, not a .dylib or a linker error.
You have to ensure that ${SDK_DIR}/usr/include/libxml2 is in your Header Search Paths in your Release configuration.
i was going around in circles this morning with this same problem with xcode 4.
again as described exactly above, it builds with fine with
Schema >
Build Configuration
--> Debug
but fails when switching it to Release
tried numerous cleans and
adding ${SDK_DIR}/usr/include/libxml2 or
$/usr/include/libxml2
and triple checking Header Search Paths / checking the recursive check box all to no avail.
Was about to start a new project when ....
I managed to resolve it by adding
${SDK_DIR}/usr/include/libxml2 to the User Header Search Paths
do make sure that libxml is included in your project , that was the one that caused the problem for me.
add libxml2.2.7.3.dylib to linked libraries