Assertion failed: (aliasSectionNum == sectionNum && "alias and its target must be located in the same section"), function assignAliasAtomOffsetInSecti
Asked Answered
A

4

6

when i tried to run ionic app in ios real device or make archive then this happen. in (https://i.sstatic.net/y1dnu.png) simulator its working fine

I'm developing an Ionic app and I've encountered a build issue when running it on a real iOS device or attempting to make an archive. While the app runs fine in the simulator, it fails with a linker command error on a real device.

Here is the error that appears:

Assertion failed: (aliasSectionNum == sectionNum && "alias and its target must be located in the same section"), function assignAliasAtomOffsetInSection, file Layout.cpp, line 3248. The full error output can be seen in this screenshot: y1dnu.png

Based on research and suggestions from other developers, I tried enabling core device support using the following terminal command:

defaults write com.apple.dt.Xcode DVTEnableCoreDevice enabled Additionally, I attempted to resolve the issue by modifying the build settings in Xcode as follows:

Navigated to Build Settings. Located Other Linker Flags. Added -ld64 flag. Despite these attempts, the issue persists.

What I Have Tried:

Cleaning the build folder in Xcode and rebuilding. Updating and reinstalling all project dependencies, including CocoaPods. Searching for any instances of duplicate symbols or conflicting libraries. Verifying that no outdated or incompatible versions of libraries are linked. Environment:

Xcode Version: 15 Questions:

Has anyone successfully resolved a similar Xcode linker command error? Could this issue be related to specific project settings that differ between simulator builds and device/archive builds? Is there an alternative approach to the -ld64 linker flag that could be more effective? Any help or insight from those who have faced and conquered this issue would be immensely appreciated.

Aspia answered 8/11, 2023 at 7:0 Comment(0)
T
11

I added the following linker flag and problem was solved.

Build Settings -> Other Linker Flags -> -ld64

Tasse answered 9/11, 2023 at 9:23 Comment(1)
The flag -ld64 is deprecated. You should use -ld_classic. See: developer.apple.com/forums/thread/715385Amusement
E
0

Are you linking against Google Nearby? Google Nearby has a dependency on GoogleUtilitiesLegacy where I suspect this linker issue is originating from.

Did you hit this issue after updating to Xcode 15?

I think Google Nearby is no longer being supported and some compiler/linker change in Xcode 15 is picking up this issue with the alias in the GoogleUtilitiesLegacy code. If we update to MacoOS Sonoma you will be forced to move to Xcode 15 as Xcode 14 is no longer supported on Sonoma.

If you can try building with Xcode 14, and will probably have to move away from using Google Nearby or fix the issue in your own fork.

Emeldaemelen answered 8/11, 2023 at 18:18 Comment(1)
yes after xcode. 15 getting this errorAspia
S
0

I'm working on an application with with ionic & cordova and was having the same error.

What solved it for me what updating the "iOS Development Target" to iOS 12.0 and AFTER that, add the "-ld64" flag to "Other Linker Flags".

I guess when I changed the target, the linker flags were reseted, because I didnt notice that the flag was missing again.

Sandal answered 23/11, 2023 at 20:22 Comment(1)
As reference, I found the solution in this Chinese post: cnblogs.com/dasonxie/p/17719260.htmlSandal
F
0

I had added the "-ld64" flag to "Other Linker Flags" on different locations (2 framework targets, 2 framework projects, project and target of main project). That didn't solve the problem. When I deleted the flags again and added it only to the target of the main project that solved the problem for me!

Fere answered 29/1 at 12:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.