Reputation: 11
I have a hybrid app created with Ionic that was originally running on Cordova, but we moved it to Capacitor a year ago and everything has been working as expected. Recently, while trying to make updates for iOS 17, I started getting this error every time I try to build for a real device (running it on a Simulator works fine):
Assertion failed: (aliasSectionNum == sectionNum && "alias and its target must be located in the same section"), function assignAliasAtomOffsetInSection, file Layout.cpp, line 3358.
Screenshot of 'Assertion failed' error shown in XCode
I updated to Ionic 8 and Capacitor 6 and updated all my plugins and code changes to go with those updates, and everything runs fine on a Simulator. But when I try to run it on my actual device I am getting this error when building. It seems to be coming from one of the Cordova Plugins, but it doesn't indicate which one.
Here are my main questions:
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
Project env details:
Ionic 8
Capacitor 6
Angular 16
Node 18
VSCode 1.9
XCode 15.4
I have been googling this for almost two weeks now and have not found any explanations as to what is actually causing the issue. Every answer I've seen just says to add '-ld64' (or 'ld_classic' as '-ld64' is deprecated according to this post: https://developer.apple.com/forums/thread/715385) to the Other Linker Flags setting in the Build Settings of the Target (as seen in the first screenshot).
This section was supposed to be a list of posts that I've already read through, but when I had all the links listed, it kept flagging my question as spam. S.O. is incredibly useful to read through, but every time I have to interact with this site it's a nightmare. Anyway, if you want the list, maybe I can post it later as a comment or edit, I don't know.
I tried adding '-ld64' - didn't work I changed it to '-ld_classic' - didn't work I added both '-ld64' and 'ld_classic' - didn't work Initially, there were a bunch of other flags already in the list: I tried both leaving them all in, and I also tried clearing them all, with all the combinations above. Didn't work. Most of the posts linked above have several other people commenting that adding the flags didn't work for them either.
Here is a screenshot of the build log right before the error: screenshot of the build log right before the error
Any help in understanding this issue is appreciated, thanks!
Upvotes: 1
Views: 308
Reputation: 3
I was in the same situation as you and what I did was check the installed Cordova plugins and the folders I had in ios > capacitor-cordova-ios-plugins > sources.
In my case, I had a "CordovaPluginStripe" folder, but I no longer had the Stripe plugin installed. After deleting that folder, I built the project again and it worked fine.
I hope this helps.
Upvotes: 0