Open dynatom opened 8 months ago
I'm not able to reproduce this. Both apps are building fine for me. Is this still an issue?
I'm not able to reproduce this. Both apps are building fine for me. Is this still an issue?
Try again, it still happen in Visual Studio 2022 (17.9.6). Use package Plugin.Firebase 2.0.6 and iOS_BindingLibrary.
2>duplicate symbol '_OBJC_CLASS_$_Testlib' in:
2> /Users/rd620/Library/Caches/Xamarin/mtbs/builds/MauiApp2/308b3e15cf66b3ab5e6aeb87e5c57ae754cde18a25c3495d5bb3b1460cec1d4b/D:/Project/APPTEST/MauiApp/iOS_BindingLibrary/bin/Debug/net7.0-ios/iOS_BindingLibrary.resources/libTestlib.a[arm64][2](Testlib.o)
2> /Users/rd620/Library/Caches/Xamarin/mtbs/builds/MauiApp2/308b3e15cf66b3ab5e6aeb87e5c57ae754cde18a25c3495d5bb3b1460cec1d4b/D:/Project/APPTEST/MauiApp/iOS_BindingLibrary/bin/Debug/net7.0-ios/iOS_BindingLibrary.resources/libTestlib.a[arm64][2](Testlib.o)
2>duplicate symbol '_OBJC_METACLASS_$_Testlib' in:
2> /Users/rd620/Library/Caches/Xamarin/mtbs/builds/MauiApp2/308b3e15cf66b3ab5e6aeb87e5c57ae754cde18a25c3495d5bb3b1460cec1d4b/D:/Project/APPTEST/MauiApp/iOS_BindingLibrary/bin/Debug/net7.0-ios/iOS_BindingLibrary.resources/libTestlib.a[arm64][2](Testlib.o)
2> /Users/rd620/Library/Caches/Xamarin/mtbs/builds/MauiApp2/308b3e15cf66b3ab5e6aeb87e5c57ae754cde18a25c3495d5bb3b1460cec1d4b/D:/Project/APPTEST/MauiApp/iOS_BindingLibrary/bin/Debug/net7.0-ios/iOS_BindingLibrary.resources/libTestlib.a[arm64][2](Testlib.o)
2>ld: 2 duplicate symbols
2>clang: error: linker command failed with exit code 1 (use -v to see invocation)
2>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\16.4.7129\targets\Xamarin.Shared.Sdk.targets(1276,3): error : clang++ 已結束,代碼為 1:
2>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\16.4.7129\targets\Xamarin.Shared.Sdk.targets(1276,3): error : ld: warning: ignoring duplicate libraries: '-lc++', '-lcompression', '-lsqlite3', '-lz', '/Users/rd620/Library/Caches/Xamarin/mtbs/builds/MauiApp2/308b3e15cf66b3ab5e6aeb87e5c57ae754cde18a25c3495d5bb3b1460cec1d4b/C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/7.0.18/runtimes/ios-arm64/native/libmono-component-debugger-static.a', '/Users/rd620/Library/Caches/Xamarin/mtbs/builds/MauiApp2/308b3e15cf66b3ab5e6aeb87e5c57ae754cde18a25c3495d5bb3b1460cec1d4b/C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/7.0.18/runtimes/ios-arm64/native/libmono-component-diagnostics_tracing-static.a', '/Users/rd620/Library/Caches/Xamarin/mtbs/builds/MauiApp2/308b3e15cf66b3ab5e6aeb87e5c57ae754cde18a25c3495d5bb3b1460cec1d4b/C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/7.0.18/runtimes/ios-arm64/native/libmono-component-hot_reload-stub-static.a'
2>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\16.4.7129\targets\Xamarin.Shared.Sdk.targets(1276,3): error : ld: warning: object file (/Users/rd620/Library/Caches/Xamarin/mtbs/builds/MauiApp2/308b3e15cf66b3ab5e6aeb87e5c5
2>專案 "MauiApp2.csproj" 建置完成 -- 失敗。
==========全部重建 : 成功 1 個,失敗 1 個,略過 0 個==========
========== 重建 已於 上午 10:36 完成並花了 03:07.842 分鐘 ==========
But if I update project to net8.0-ios, It will compile success, but deploy failed. (Debug mode deploy failed, still can achieve release mode for TestFlight.) Maybe only compile error in net7.0-ios?
Use clean maui project and clean ios binding library. If only use Plugin.Firebase package, it will compile success. If only use ios binding library, it will compile success, too. But add these two to references, compile will show "duplicate symbol" error. And the duplicate symbol is in same static library and same path.
I use this solution for test: MauiApp.zip MauiApp1 -> The maui project, only uses binding library reference. MauiApp2 -> The maui project, uses both binding library and plugin.firebase package. iOS_BindingLibrary -> The binding library project. Testlib -> Xcode project for iOS_BindingLibrary. A simple static library for test.
Compile log of MauiApp1 is: CleanBuild.log Compile log of MauiApp2 is: HasFirebase.log The error message is like this, duplicate symbol happened in same file.
The Work Enviroment: Win 10 + Visual Studio 2022 (17.8.5) MacOS Sonoma 14.3.1(23D60)+ Xcode 15.3 (15E204a)