Skip to content

DYLD 4 Symbol Missing AdamE.Firebase.iOS* Linking Issue #83

@howitzergamesllc

Description

@howitzergamesllc

Before reporting a bug:

  • I have read the project readme and followed all instructions.
  • I have searched this project and the Plugin.Firebase project for potentially duplicate issues (even closed ones).
  • Added additional references to latest packages to resolve build issues previously closed as completed.
  • Added the additional nuget packages using powershell outside of the IDE
  • Specified the runtime and signed with a valid provisioning profile
  • Added the linker flag from the readme file, it doesn’t seem to matter whether or not its in the csproj.
  • Removing the Plugin.Firebase convent whole package and only used specific used packages (analytics, cloud messaging, crashlytics).
  • Each change to csproj and nugets was followed by nuget and XBD cache clearing, obj/bin deletions, dotnet restore/build outside of Visual Studio IDE.
  • Each package added resulted in the next absent being referenced in the error so I added all of the AdamE.Firebase.iOS* packages to see if it would resolve the issue.

Describe the bug
The application successfully builds but then crashes with the following error messages from the debug console:

To Reproduce
Steps to reproduce the behavior:

  1. Build a new .net maui project
  2. Install latest plugins for firebase, Plugin.Firebase and AdamE.Firebase.iOS.Core
  3. Follow all steps in Readme files (Install packages outside of visual studio using power shell (macbook), Linker flag addition to project, Nuget cache cleared, XamarinBuildDownload cache removal, full project clean bin/obj folders deleted, dotnet restore outside of visual studio, dotnet build outside of visual studio).
  4. Build failed initially citing missing firebase analytics.
  5. Added AdamE.Firebase.iOS.Analytics reference to csproj.
  6. Build failed a second time referencing missing GMTSessionFetcher.
  7. Added AdamE.Google.iOS.GTMSessionFetcher reference to csproj.
  8. Builds and installs successfully only now it crashes on app startup citing the error message above.
  9. Follow steps in Readme files again (Nuget cache cleared, XamarinBuildDownload cache removal, full project clean bin/obj folders deleted, dotnet restore outside of visual studio, dotnet build outside of visual studio).
  10. Build fails with the same error message below.
  11. Added AdamE.Firebase.iOS.Firestore reference and package to project.
  12. Follow steps in Readme files again (Nuget cache cleared, XamarinBuildDownload cache removal, full project clean bin/obj folders deleted, dotnet restore outside of visual studio, dotnet build outside of visual studio).
  13. Deployment error is exactly the same except the package reference changed to FirebaseRemoteConfig.
  14. Added all AdamE.Firebase.iOS* packages.
  15. Follow steps in Readme files again (Nuget cache cleared, XamarinBuildDownload cache removal, full project clean bin/obj folders deleted, dotnet restore outside of visual studio, dotnet build outside of visual studio).
  16. Deployment error is exactly the same with a reference to FirebaseRemoteConfig.
  17. See error

Expected behavior
Build and deploy successfully.

Error messages
error HE1045: Failed to execute 'devicectl': 'devicectl -j /var/folders/b3/0lxs40sd41v70zqtdndnqmpm0000gn/T/tmpPcf12Z.tmp device process launch --terminate-existing --device 00008110-001145E13AE8401E --console com.company.MyMauiApp' returned the exit code 1.

error HE1046: Additional output: xcrun devicectl -j /var/folders/b3/0lxs40sd41v70zqtdndnqmpm0000gn/T/tmpPcf12Z.tmp device process launch --terminate-existing --device 00008110-001145E13AE8401E --console com.company.MyMauiApp

error HE1046: Additional output: dyld[13554]: Symbol not found: __ZN5swift39swift51override_conformsToSwiftProtocolEPKNS_14TargetMetadataINS_9InProcessEEEPKNS_24TargetProtocolDescriptorIS1_EEN7__swift9__runtime4llvm9StringRefEPFPKNS_35TargetProtocolConformanceDescriptorIS1_EES4_S8_SC_E

error HE1046: Additional output: Referenced from: <9B687E21-801B-34A8-BC2F-D2811C85D21C> /private/var/containers/Bundle/Application/8CB99D8C-27B6-47DF-97E3-DA36BF385C7C/MyMauiApp.app/Frameworks/FirebaseFirestore.framework/FirebaseFirestore

error HE1046: Additional output: Expected in: <34DD8225-075B-3F6E-9467-C22809180549> /private/var/containers/Bundle/Application/8CB99D8C-27B6-47DF-97E3-DA36BF385C7C/MyMauiApp.app/Frameworks/FirebaseSharedSwift.framework/FirebaseSharedSwift

And the following error message from the symbolicated crashlogs:
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Reason: DYLD 4 Symbol missing
Symbol not found: __ZN5swift39swift51override_conformsToSwiftProtocolEPKNS_14TargetMetadataINS_9InProcessEEEPKNS_24TargetProtocolDescriptorIS1_EEN7__swift9__runtime4llvm9StringRefEPFPKNS_35TargetProtocolConformanceDescriptorIS1_EES4_S8_SC_E
Referenced from: <9B687E21-801B-34A8-BC2F-D2811C85D21C> /Volumes/VOLUME//MyMauiApp.app/Frameworks/FirebaseFirestore.framework/FirebaseFirestore
Expected in: <34DD8225-075B-3F6E-9467-C22809180549> /Volumes/VOLUME/
/MyMauiApp.app/Frameworks/FirebaseSharedSwift.framework/FirebaseSharedSwift
(terminated at launch; ignore backtrace)

Screenshots
N/A

Environment (please complete the following information):

  • Using Macbook Pro M1 Max Sequoia 15.3.2
  • OS: iOS, arm64
  • IDE (if applicable): Visual Studio and dotnet PowerShell
  • .NET version: 9.0.3
  • .NET SDK version: 9.0.202
  • XCode version: 16.2
  • Plugin.Firebase Version: 3.1.4
  • AdamE.Firebase.iOS.Core: 11.10.0

.csproj

Current Status:
<!-- iOS - Debug -->
<PropertyGroup Condition="$(TargetFramework.Contains('-ios')) and '$(Configuration)' == 'Debug'">
	<_ExportSymbolsExplicitly>false</_ExportSymbolsExplicitly>
	<MtouchLink>SdkOnly</MtouchLink>
	<CodesignKey>mykey</CodesignKey>
	<CodesignProvision>myprovision</CodesignProvision>
	<CodesignEntitlements>Platforms\iOS\Entitlements.iOS.Debug.plist</CodesignEntitlements>
	<UseHardenedRuntime>true</UseHardenedRuntime>
</PropertyGroup>

<ItemGroup>
	<PackageReference Include="CommunityToolkit.Maui" Version="11.2.0" />
	<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.50" />
	<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="9.0.50" />
	<PackageReference Include="Microsoft.Maui.Essentials" Version="9.0.50" />
	<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.4" />
	<PackageReference Include="Plugin.Firebase" Version="3.1.4" />
	<PackageReference Include="Plugin.InAppBilling" Version="8.0.5" />
	<PackageReference Include="Plugin.Maui.Audio" Version="3.1.1" />
	<PackageReference Include="Plugin.MauiMTAdmob" Version="2.0.0.5" />
	<PackageReference Include="ReactiveUI" Version="20.1.63" />
	<PackageReference Include="ReactiveUI.Fody" Version="19.5.41" />
	<PackageReference Include="ReactiveUI.Maui" Version="20.1.63" />
	<PackageReference Include="sqlite-net-pcl" Version="1.9.172" />
	<PackageReference Include="SQLitePCLRaw.bundle_green" Version="2.1.11" />
	<PackageReference Include="System.Text.Json" Version="9.0.4" />
	<PackageReference Include="Xamarin.Build.Download" Version="0.11.4" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net9.0-ios'">
	<PackageReference Include="AdamE.Firebase.iOS.Core" Version="11.10.0" />
	<PackageReference Include="AdamE.Firebase.iOS.Analytics" Version="11.10.0" />
	<PackageReference Include="AdamE.Google.iOS.GTMSessionFetcher" Version="4.3.0" />
</ItemGroup>

<!--Needed for Crashlytics on iOS-->
<!-- Target needed until LinkWithSwiftSystemLibraries makes it into the SDK: https://github.com/xamarin/xamarin-macios/pull/20463 -->
<Target Name="LinkWithSwift" DependsOnTargets="_ParseBundlerArguments;_DetectSdkLocations" BeforeTargets="_LinkNativeExecutable">
	<PropertyGroup>
		<_SwiftPlatform Condition="$(RuntimeIdentifier.StartsWith('iossimulator-'))">iphonesimulator</_SwiftPlatform>
		<_SwiftPlatform Condition="$(RuntimeIdentifier.StartsWith('ios-'))">iphoneos</_SwiftPlatform>
	</PropertyGroup>
	<ItemGroup>
		<_CustomLinkFlags Include="-L" />
		<_CustomLinkFlags Include="/usr/lib/swift" />
		<_CustomLinkFlags Include="-L" />
		<_CustomLinkFlags Include="$(_SdkDevPath)/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/$(_SwiftPlatform)" />
		<_CustomLinkFlags Include="-Wl,-rpath" />
		<_CustomLinkFlags Include="-Wl,/usr/lib/swift" />
	</ItemGroup>
</Target>

What I have Tried

Additional context

  • Builds, deploys, and publishes on Android with an additional reference to the latest Xamarin.Firebase.Analytics.
  • Each additional AdamE.Firebase.iOS* package reference would sometimes change the error message received to state a different package than the Firestore package. For example, adding the Firestore reference or package to the project then causes the error to reference a different package so on and so forth. Adding all of the packages did not get rid of the error however.

-Three additional warnings appear on successful builds
warning MT7091: The framework /Users/user/Library/Caches/XamarinBuildDownload/FAnlytcs-11.10.0/FirebaseAnalytics-11.10.0/Frameworks/FirebaseAnalytics.xcframework/ios-arm64/FirebaseAnalytics.framework is a framework of static libraries, and will not be copied to the app.
warning MT7091: The framework /Users/user/Library/Caches/XamarinBuildDownload/GAppM-11.10.0/GoogleAppMeasurement-11.10.0/Frameworks/GoogleAppMeasurement.xcframework/ios-arm64/GoogleAppMeasurement.framework is a framework of static libraries, and will not be copied to the app.
warning MT7091: The framework /Users/user/Library/Caches/XamarinBuildDownload/GAppM-11.10.0/GoogleAppMeasurement-11.10.0/Frameworks/GoogleAppMeasurementIdentitySupport.xcframework/ios-arm64/GoogleAppMeasurementIdentitySupport.framework is a framework of static libraries, and will not be copied to the app

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions