Hello all!
Writing own example of using Swift/CPP interoperability. Got stacked with this error when building it:
[1/2 3.8/sec] Building CXX object CMakeFiles/UsingSwiftCPPInterop_v1.dir/main.cpp.o
[2/2 3.0/sec] Linking Swift executable UsingSwiftCPPInterop_v1
FAILED: UsingSwiftCPPInterop_v1 CMakeFiles/UsingSwiftCPPInterop_v1.dir/Swift/atestmodule.swift.o
duplicate symbol '_main' in:
../CMakeFiles/UsingSwiftCPPInterop_v1.dir/main.cpp.o
../CMakeFiles/UsingSwiftCPPInterop_v1.dir/Swift/atestmodule.swift.o
ld: 1 duplicate symbols
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
What is missing by me? The code of CMake project published here
My build envieionment:
CMake 3.29.3
MacOS 14.7.1
In this project Swift files linked directly to project/target. Should it be separated to library target o there must be some parameters that is telling clang to compile it without main?
Dive into the vast array of tools, services, and support available to developers.
Post
Replies
Boosts
Views
Activity
Lost access to all the build artifacts in Xcode Cloud.
When I try downloading any build artifact from the web page I'm getting:
{"message":"You are not authorized to access this team’s resources."}
Same attempt from Xcode just crashes the app.
Started to happen today or some time yesterday, after 12am EST.
Hello, I'm kinda new to Xcode and I was trying to get back to programming while I follow a course.
There seemed to be a problem with the preview and it looks like there was nothing wrong with the code, at least from what I know. I can say this because the code is the default one that Xcode gives you when you start a new project.
here is the error log.
== PREVIEW UPDATE ERROR:
SchemeBuildError: Failed to build the scheme “App”
linker command failed with exit code 1 (use -v to see invocation)
Link App.debug.dylib (arm64):
Undefined symbols for architecture arm64:
"_main", referenced from:
___debug_main_executable_dylib_entry_point in command-line-aliases-file
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
== PREVIEW UPDATE ERROR:
SchemeBuildError: Failed to build the scheme “App”
linker command failed with exit code 1 (use -v to see invocation)
Link App.debug.dylib (arm64):
Undefined symbols for architecture arm64:
"_main", referenced from:
___debug_main_executable_dylib_entry_point in command-line-aliases-file
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
PLATFORM AND VERSION
iOS
Development environment: Xcode 15.4, macOS Sonoma 14.5
Run-time configuration: macOS Sonoma 14.5
DESCRIPTION OF PROBLEM
Hi, I'm on DriverKit 21.0. I'm looking for a system call (that isn't deprecated) in my driver to set the Ethernet link speed manually. Normally a user would set it by System Settings... -> Network -> -> Details -> Hardware -> Configure (Manually), and then Speed (choose the link speed). With my driver, when I configure for manual, no link speeds show up. I want to know how to populate the speeds (1000BaseT, etc.) so a user can select one. What system APIs are used for this? I can't find much detail in the documentation. I do see Instance Methods for some related things like getSupportedMediaArray, but most of these newer methods don't have details in the documentation to guide me on what they actually do. Thanks in advance...
Hello fellow developers,
My team has been running into a persistent INVALID_CLIENT error while trying to implement Sign In With Apple JS in our Nextjs app with signInWithPopup from firebase/auth. Here is the full error:
Error getting access token from https://appleid.apple.com, OAuth2 redirect uri is: https://[redacted]/__/auth/handler, response: OAuth2TokenResponse{params: error=invalid_client, httpMetadata: HttpMetadata{status=400, cachePolicy=NO_CACHE, cacheDurationJava=null, cacheImmutable=false, staleWhileRevalidate=null, filename=null, lastModified=null, retryAfter=null, crossOriginEmbedderPolicy=null, crossOriginOpenerPolicy=null, crossOriginResourcePolicy=null, permissionsPolicies=[], headers=HTTP/1.1 200 OK, contentSecurityPolicies=[], originTrials=[], reportToHeaders=[], varyHeaderNames=[], cookieList=[]}}
I've checked every thread on these forums and stackoverflow for solutions to this very common issue, and we tried them all. We made sure to verify that the Services ID, Apple Team ID, Key ID and Private key are all correctly used in the firebase console, we have regenerated our keys, all to no avail.
We also contacted Apple Support via the Development And Technical option with Certificates, Identifiers, and Provisioning Profiles topics, but they directed us to code-level support, which excludes 3rd Party libraries so this does not seem appropriate for us.
Does anyone have any idea of what might be wrong or suggestions for something we could try? We are able to get the pop up to open with an Apple login form, allow us to enter the credentials, but then when we hit continue the error occurs.
We are using firebase version ^10.4.0
Any help would be greatly appreciated and let me know if I need to provide any additional info. Thank you.
Hi everyone,
I’m planning to develop a cross-platform PDF viewer app for iOS and macOS that will read PDFs from local storage and cloud services (Google Drive, iCloud, WorkDrive, etc.). The app should be read-only and display both the PDF content and its metadata (author, title, creation date, etc.).
Key Features:
View PDFs: Local and remote (cloud storage integration).
Display metadata: Title, author, page count, etc.
Cloud integration: Google Drive, iCloud, Zoho WorkDrive, etc.
Read-only mode: No editing features, just viewing.
Questions:
Xcode Template: Should I use the Document App or Generic App template for this?
PDF Metadata: Any built-in libraries for extracting PDF metadata in a read-only app?
Performance: Any advice or documentation on handling large PDFs or cloud fetching efficiently?
Thanks in advance for any advice or resources!
We applied for Location Push Entitlement on June. It has been several months since then but we still got not any results (either passed or rejected). Can anyone tell us what's going on?
Hi!
We use to have several workspaces for our SDKs, one of them containing a test application. Everything worked fine.
We decided to "merge" all SDKs in one workspace. I create a new workspace, added all SDKs and application inside and made all the required changes. Everything's good, we can generate our XCFramework and run the test application on the simulator. But when I archive the application, it is now exported in an "Other" section of the organizer instead of the original app (bundles identifiers are the same, already checked).
I compared with FileMerge the xcproject files from before and after the merge, there is no significant difference between the 2.
I compared also the xcarchive folders, and it seems that the archive is now missing the ApplicationProperties key inside. If I add it manually, I can now generate an ipa or send it to testflight.
I checked with ChatGPT (just in case), but everything it asked me to check was fine (bundle ids, bundle versions and build number, Bundle os type in info.plist, custom xcconfig (same issue without them)). I'm pretty stuck here :-/
Thanks for your help
I have defined a method appendString method in a NSMuatableAttributedString category like this:
@implementation NSMutableAttributedString (HTML)
// appends a plain string extending the attributes at this position
- (void)appendString:(NSString *)string
{
NSParameterAssert(string);
NSUInteger length = [self length];
...
And this method is worked well in iOS17 and before .
But when it cames iOS18 . this appendString will not be called.
So I doubt maybe there is a system-defined appendString already.
So I write a demo in empty project to print all the NSMuatableAttributedString method in iOS18 like these:
@interface ViewController ()
@end
@implementation ViewController
void printNSStringCategories() {
unsigned int count;
Class nsStringClass = [NSMutableAttributedString class];
// 获取所有的方法
Method *methods = class_copyMethodList(nsStringClass, &count);
for (unsigned int i = 0; i < count; i++) {
SEL selector = method_getName(methods[i]);
NSString *methodName = NSStringFromSelector(selector);
NSLog(@"NSMutableAttributedString method: %@", methodName);
}
free(methods);
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
printNSStringCategories();
}
And test it in my iPhone (iOS18.2) , the log will printed
NSMutableAttributedString method: appendString:withAttributes:
NSMutableAttributedString method: cr_appendStorage:fromRange:
NSMutableAttributedString method: cr_appendString:
NSMutableAttributedString method: appendString:withAttributes:
NSMutableAttributedString method: appendString:
So it seems a appendString: is aleady defined in system SDK .
But the weird thing is when I run this code in the Xcode simulator (iOS18.1) this appendString: will not print .
1 Is it a bug of SDK ? because the appendString: only exist in device-build , and not exist in simulator-build?
two more furthur question:
2.1 if the SDK contains appendString: already , why the appendString: defined in my category not cause the duplicate symbol error when compile
2.2 As the question 2.1 said , there maybe same symbols in runtime . Is there any way to find the framework/library which defined those same-name symbols ? (e.g: there are two appendString:withAttributes: in the log , I want to find the two places define each appendString:withAttributes: exactly)
I am developing an access controller RF (NFC).
I know that the ADP developer account can only handle NFC Tags.
Can I use NFC AID and HCE in ADEP?
ADEP supports hotel card keys, employee badges, etc. Is it NFC?
Or is it NFC+BLE?
Does anyone know a workaround for this issue during downloads?
Predictive Code Completion Model
Failed -- There was an error processing the asset.
I have tried installing the latest Xcode 16.1 and 16.2beta2, and both fail the same way. It has not been resolved for 2 days, so I don't think it is temporary server issue. I also tried 2 different network providers and a hotspot as related posts with different details mentioned.
Details:
The operation couldn’t be completed. (IDELanguageModelKit.IDEModelDownloadAdapter.(unknown context at $13003dd20).DownloadError error 3.)
The operation couldn’t be completed. (IDELanguageModelKit.IDEModelDownloadAdapter.(unknown context at $1101b5d90).DownloadError error 3.)
FB15799470
FB15801257
The problem is that when building the application with Debug mode on Xcode 16.1, the dSYM files fail to upload to Crashlytics.
It worked in latest Xcode 15 version.
The workaround is to disable Debug Dylib Support in the target's Build Settings. However, this causes SwiftUI previews to stop working.
Reproducing the issue
Set ENABLE_DEBUG_DYLIB=YES for build options
Build the application in Xcode 16.1
Firebase SDK Version
11.4.0
Xcode Version
16.1
Installation Method
Swift Package Manager
Firebase Version 11.5.0
Relevant Log Output
warning: (arm64) /Users/dustin/Library/Developer/Xcode/DerivedData/MyAppName-cicejndcecececfe/Build/Products/Debug-iphonesimulator/MyAppName.app/ MyAppName empty dSYM file detected, dSYM was created with an executable with no debug info.
The warning seems like is from XCode/lldb compiler rather than Crashlytics (https://lldb.llvm.org/cpp_reference/SymbolFileDWARF_8cpp_source.html line655).
This is probably something on Apple side, Crashlytics only consumes dSYM which is generated from Xcode. (ref:https://github.com/firebase/firebase-ios-sdk/issues/14054#issuecomment-2477235548)
This is related to:
Firebase Issue
when trying to build wireshark I'm getting the following, any idea how to solve it?
[ 13%] Building C object wsutil/CMakeFiles/wsutil.dir/os_version_info.c.o
In file included from wireshark/wsutil/os_version_info.c:23:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:54:
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:676:195: error: expected ','
676 | void *CFAllocatorAllocateTyped(CFAllocatorRef allocator, CFIndex size, CFAllocatorTypeID descriptor, CFOptionFlags hint) API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0), visionos(2.0));
| ^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:679:211: error: expected ','
679 | void *CFAllocatorReallocateTyped(CFAllocatorRef allocator, void *ptr, CFIndex newsize, CFAllocatorTypeID descriptor, CFOptionFlags hint) API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0), visionos(2.0));
| ^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:682:165: error: expected ','
682 | void *CFAllocatorAllocateBytes(CFAllocatorRef allocator, CFIndex size, CFOptionFlags hint) API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0), visionos(2.0));
| ^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:685:181: error: expected ','
685 | void *CFAllocatorReallocateBytes(CFAllocatorRef allocator, void *ptr, CFIndex newsize, CFOptionFlags hint) API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0), visionos(2.0));
| ^
In file included from wireshark/wsutil/os_version_info.c:23:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:73:
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumberFormatter.h:144:147: error: expected ','
144 | CF_EXPORT const CFNumberFormatterKey kCFNumberFormatterMinGroupingDigits API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0), visionos(2.0)); // CFNumber
| ^
5 errors generated.
make[2]: *** [wsutil/CMakeFiles/wsutil.dir/os_version_info.c.o] Error 1
make[1]: *** [wsutil/CMakeFiles/wsutil.dir/all] Error 2
make: *** [all] Error 2
Have a rare crash in one of our framework which I am unable to figure out.
Attaching the crash log here. Any idea how to debug this to find the root cause?
Crash.crash
--- This post is easier to read with BBEdit and C++ colouring.---
We get strange problems with breakpoints appearing after migration (MacBook x86_64 Sequoia to Mac M3 arm64 Sequoia).
Context
We have kept our app on the MacBook and experimented no problems.
We use clang++ and lldb.
Xcode is installed but we use only CommandLineTools (no XCode project) -- and git on our lab forge.
After using the Apple migration tool, we got many problems in compiling and link-edit, in particular for dylibs.
We uninstalled all these tools and reinstalled them, using Homebrew for llvm and lld, and from AppleStore for Xcode.
We also added to our CPPFLAGS -arch arm64 -w -g -O0.
We use 'make' recursively (in principle, 0 or 1 Makefile per folder.
Problems
Our app crashes unexpectedly:
without lldb:
...Serveur: serveur.out
...
stop reason = EXC_BREAKPOINT (code=1, subcode=0x1000c662c) at descripteursDeNoeuds.cpp:947:15
with lldb:
...Serveur: lldb serveur.out -arch aarch64
(lldb) process launch
...
Process 2081 stopped
thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BREAKPOINT (code=1, subcode=0x1000c6388)
frame #0: 0x00000001000c6388 serveur.out`creerDescrDLING(m=1, bImpr=false) at descripteursDeNoeuds.cpp:947:15
We can set breakpoints, but the location is OK relative to some files, and "pending" for the file where the crash seems to occur.
...Serveur: lldb serveur.out -arch aarch64
(lldb) target create --arch=aarch64 "serveur.out"
Current executable set to '/Users/boitet/ariane-y/Ariane-Y_prog_2013/Moniteurs/Moniteur-AY/Serveur/serveur.out' (arm64).
(lldb) br set -f initDling.cpp -l 150
Breakpoint 1: where = serveur.out`initDling(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator>) + 1336 at initDling.cpp:150:30, address = 0x00000001000e0ebc
(lldb) br set -f descripteurDeNoeuds.cpp -l 886
Breakpoint 2: no locations (pending).
WARNING: Unable to resolve breakpoint to any actual locations.
(lldb) br set -f descripteurDeNoeuds.cpp -l 947
Breakpoint 3: no locations (pending).
WARNING: Unable to resolve breakpoint to any actual locations.
(lldb) br set -f initDling.cpp -l 153
Breakpoint 4: where = serveur.out`initDling(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator>) + 1364 at initDling.cpp:153:23, address = 0x00000001000e0ed8
(lldb) br set -f descripteurDeNoeuds.cpp -l 912
Breakpoint 5: no locations (pending).
WARNING: Unable to resolve breakpoint to any actual locations.
(lldb) br set -f descripteurDeNoeuds.cpp -l 3344
Breakpoint 6: no locations (pending).
WARNING: Unable to resolve breakpoint to any actual locations.
==> We can set breakpoints in the caller (initDling) but not in descripteurDeNoeuds.cpp.
==> Here, we set 2 "normal" breakpoints at lines 150 and 153 of initDling.cpp, and they work well: normal stop, step-over
==> descripteurDeNoeuds.cpp contains 1 master procedure (creerDescrDepuisNoeud) that calls more specific procedures (like creerDescrDLING)
==> continuation
(lldb) process launch
Process 2081 launched: '/Users/boitet/ariane-y/Ariane-Y_prog_2013/Moniteurs/Moniteur-AY/Serveur/serveur.out' (arm64)
"==============> main (du serveur)
... $$$ 4: initDling: créer les descripteurs de nœud des nœuds de cet arbre
$$$ 5: initDling : --> creerDescrDepuisNoeud(j=1, 0x14a068000), i = 1, gauche(j) = 2, droit(j) = 1, benj(j) = 1
Process 2081 stopped
thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame #0: 0x00000001000e0ebc serveur.out`initDling(nomFich="../../../INCL/fichInitDling.arbDS") at initDling.cpp:150:30
147 /*** <-TRACE / }
148 149 /**************************************/
-> 150 rc = creerDescrDepuisNoeud(j, paxml);
151 /**************************************/
152 153 / ->TRACE ***/ if (tr>1) {
(lldb) th step-over
============================================================================
$$$ 4: creerDescrDepuisNoeud (mPar = 1, pAxmlPar = 0x14a068000)
$$$ 5: creerDescrDepuisNoeud -- boucle : nomBalise = DLING, strTempo = ANNOTATIONS, trouve = 0, k = 482
$$$ 5: creerDescrDepuisNoeud -- boucle : nomBalise = DLING, strTempo = Corpus, trouve = 0, k = 483
...
==> strange EXC_BREAKPOINT
...
indNOEUD : 1
adrDESCR : 105553137336320
"==> arrêt forcé, descripteurDeNoeuds.cpp -l 966: on attend 1 seconde
"==> et on exécute 'n = n / 0;' avec n = 20... mais on a ENSUITE :
"==> stop reason = EXC_BREAKPOINT (code=1, subcode=0x1000c662c) at descripteursDeNoeuds.cpp:947:15
==> The instruction 'n = n / 0;' mentioned in the message is NOT executed as it was commented out (line 964).
==> There is no division by 0 in this code.
==> the last 3 lines of the trace are produced by cout instructions, at lines 962--965
==> system-originated EXC_BREAKPOINT, at a wrong line (947) in any case!
Process 2081 stopped
thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BREAKPOINT (code=1, subcode=0x1000c6388)
frame #0: 0x00000001000c6388 serveur.out`creerDescrDLING(m=1, bImpr=false) at descripteursDeNoeuds.cpp:947:15
944 if (pAxml->lAttr.benj(i)) fini = true; else i = pAxml->lAttr.droit(i);
945 } // while (!fini)
946 // Imprimer le descripteur si le 2° paramètre (booléen) est vrai
-> 947 if (bImpr || bDescr) // breakpoint set -f descripteurDeNoeuds.cpp -l 947 ne va pas
948 { cout<<"--------------------------------------------------------"<<endl;
949 cout<<"--- DescrDLING("<<m<<"), "<<"pDescr="<<pDescr<<" ---"<<endl;
950 cout<<"codeBalAY : "<codeBalAY<<endl;
(lldb)
==> but we are at line 966, not 947
==> And at line 967, there is nothing special:
if (bImpr || bDescr) // breakpoint set -f descripteurDeNoeuds.cpp -l 947 ne va pas
{ cout<<"--------------------------------------------------------"<<endl;
cout<<"--- DescrDLING("<<m<<"), "<<"pDescr="<<pDescr<<" ---"<<endl;
==> continuation, interruption and backtrace
(lldb) p (bImpr || bDescr)
(bool) true
(lldb) p bImpr
(bool) false
(lldb) p bDescr
(bool) true
(lldb) (bool) true
(lldb) bt
thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BREAKPOINT (code=1, subcode=0x1000c6388)
frame #0: 0x00000001000c6388 serveur.out`creerDescrDLING(m=1, bImpr=false) at descripteursDeNoeuds.cpp:947:15
frame #1: 0x00000001000dd710 serveur.out`creerDescrDepuisNoeud(mPar=1, pAxmlPar=0x000000014a068000) at descripteursDeNoeuds.cpp:3406:41
...
==>
==> After that, we are blocked, no step or continue instruction works. Then we quit.
We could not find this exact subcode (0x1000c6388) on the Web.
We found a post mentioning a similar problem, with another subcode (0x100308448).
https://stackoverflow.com/questions/45413088/error-exc-breakpoint-code-1-subcode-0x100308448
But the author worked under Xcode, and we don't.
I'm confused by documentation and information I found regarding compatibility between versions of Xcode and macOS.
The site https://developer.apple.com/support/xcode/ is listing "Minimum OS required".
To my understanding it means "this particular version of macOS and all later/newer versions".
Also release notes for Xcode are consistently stating "Xcode xx.x. requires a Mac running macOS yy.yy.y or later."
But I also found statements like " In general, new versions of macOS will not run old versions of Xcode." in this forum, see https://forums.developer.apple.com/forums/thread/760737, which is the opposite to "requires macOS version X or later".
I'm also experiencing issues when trying to run Xcode 12.4 on macOS 14.5 (Sonoma), means XCode is not running.
It would be great if some of Apple Engineers here would shed some light on it :-)
Many thanks in advance!
Cheers,
Elena
Hi,
I need to pass the launch arguments through xcodebuild command. Is there a way to do it?
I know we can edit scheme and add launch argument but it needs to be added to through command line.
P.S: I'm using azure devops @Xcode5 to build and sign the .ipa
xcodebuild -sdk iphoneos -configuration Debug -workspace my.xcworkspace -scheme myScheme clean CODE_SIGNING_ALLOWED=NO -launchArgument "MyLaunchArguments"
Couple of days ago I installed ios 18.2 beta update and now my iphone 15 pro drains battery and overheats like hell. It is difficult to touch. and as i plug out my charger, the battery drains very fast (30% to O% in 10 minutes with no literally no use)
To note, my battery health is 100% with around 176 battery cycles and i always use original apple 20W charger and cable.
I have even changed the charger to a new original apple 20W charger and the issue persists. I have reset it but still the same happens. so it is lying dead for 2 days because i cannot charge it because of extreme heating. I got it checked at apple authorised service center as mentioned on apple website, they said they would reinstall the software in warranty. today they said they said the issue persists after sofware reinstallation and saying it is hardware thing.
What should i do??
Hi Team,
How can I share info beetween two differnt App. What king of approach should I use. Thanks in advance.
In my case I whant to share a token or an string like "GM-8090"
I'm encountering an issue while trying to enroll in the Apple Developer Program using the mobile app. Every time I attempt to proceed, I receive the following error message: "There may be an issue with your account that needs to be resolved before you can continue."
I have verified my account information and followed all the necessary steps. I sent an email to Apple, but I haven’t received a response for several days.
I’d be grateful for any help if anyone else has experienced this issue.