We recently upgraded our mac at the company so we could update to xcode 15 (we were previously stuck to xcode 14.2). When I went to build the app we are developing for quite some time now for iOS I encountered a problem with clang++, to be exact it threw this error
clang exited with code1:
ld: warning: ignoring duplicate libraries: '-lSystem.IO.Compression.Native', '-lSystem.Native', '-lSystem.Net.Security.Native', '-lSystem.Security.Cryptography.Native.Apple', '-lcompression', '-lmono-component-debugger', '-lmono-component-diagnostics_tracing', '-lmono-component-hot_reload', '-lmonosgen-2.0', '-lxamarin-dotnet-debug'
ld: building for 'iOS-simulator', but linking in object file (/Users/user/Library/Caches/Xamarin/mtbs/builds/Project/8618b5190f6d6128dea985b3e984c867243d6f87f73c5927fc8c844f1e1e1b50/obj/Debug/net7.0-ios/iossimulator-arm64/linker-cache/e_sqlite3.a[arm64][2](sqlite3.o)) built for 'iOS'
1>clang: error: linker command failed with exit code 1 (use -v to see invocation)
After looking at the project I found the cause of the issue. The application uses a library by Dev Express for XPO, this library relies on Microsoft.Data.Sqlite and this library specifically, when installed, produces the issue.
I tried different version of said library, specifically I tried the following
- 7.0.0
- 7.0.1
- 7.0.2
- 7.0.3
- 7.0.4
- 7.0.5
- 7.0.7
- 7.0.8
- 7.0.9
- 7.0.10
- 7.0.11
Still no dice, I even created a whole new project and individually added the libraries one by one and it still crashes on the new application once Microsoft.Data.Sqlite is installed.
As a desperate measure I even changed the simulator from 17.0 to 16.2 and you can guess how well that went.
2
Answers
I talked with Dev Express support and got my answer. The problem seems to be on the Microsoft side of things, it is weird that it didn't work on iOS 16.2 but I haven't tested multiple versions of Microsoft.Data.Sqlite on iOS 16.2 and 16.1.
This might be resolved in the future when Microsoft.Data.Sqlite 8.0.0 comes out, right now it is at a pre-release state.
If I hear anything else from Dev Express I will just add a comment to this post to inform you.
The problem is that both "Microsoft.EntityFrameworkCore.Sqlite" and "sqlite-net-pcl" are installed in Xamarin / Maui, and deleting one of them can run perfectly.
Sqlite-net-pcl used by official documents.
But I think EFcore.sqlite is stronger.