AdamEssenmacher / GoogleApisForiOSComponents

A community-supported fork of the abandoned Xamarin.iOS.* binding libraries from Microsoft
MIT License
40 stars 7 forks source link

EXEC : error : /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip: missing argument( #14

Closed gataflow closed 1 month ago

gataflow commented 1 month ago

I'm unable to Build MAUI Project with AdamE.Firebase.iOS.Analytics

Description: I am encountering an error while attempting to build my MAUI project with the AdamE.Firebase.iOS.Analytics package. Despite only utilizing this package without any dependencies on others from the Firebase iOS suite, the build fails with the following error:

EXEC : error : /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip: missing argument(s) to: -o option
/Users/victor/.nuget/packages/adame.firebase.ios.core/10.24.0/buildTransitive/AdamE.Firebase.iOS.Core.targets(226,5): error MSB3073: The command "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip -r -o " exited with code 1.

Environment:

Steps to Reproduce:

  1. Create a MAUI project.
  2. Add the AdamE.Firebase.iOS.Analytics package with version 10.24.0.
  3. Attempt to build the project.

Expected Behavior: The project should build successfully without any errors related to the Firebase iOS Analytics package.

Actual Behavior: The build fails with the mentioned error related to bitcode_strip missing arguments.

Additional Information:

Project Configuration (relevant parts):

<Project Sdk="Microsoft.NET.Sdk">
    <!-- Other properties and configurations -->
    <PropertyGroup>
        <TargetFrameworks>net8.0-android;net8.0-ios</TargetFrameworks>
        <!-- Other configurations -->
        <LinkWithSwiftSystemLibraries>true</LinkWithSwiftSystemLibraries>
    </PropertyGroup>
  <!-- Debug Configuration -->
    <PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-ios|AnyCPU'">
      <CreatePackage>false</CreatePackage>
      <CodesignProvision>Automatic</CodesignProvision>
      <CodesignKey>iPhone Developer</CodesignKey>
      <CodesignEntitlements>Platforms\iOS\Dev\Entitlements.plist</CodesignEntitlements>
      <MtouchDebug>true</MtouchDebug>
      <MtouchLink>None</MtouchLink>
      <ForceSimulatorX64ArchitectureInIDE>true</ForceSimulatorX64ArchitectureInIDE>
    </PropertyGroup>    
    <ItemGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
        <PackageReference Include="BTProgressHUD" Version="2.0.1" />
        <PackageReference Include="AdamE.Firebase.iOS.Analytics" Version="10.24.0" />
    </ItemGroup>
    <ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
        <PackageReference Include="AndHUD" Version="2.0.1" />
        <PackageReference Include="Xamarin.Firebase.Messaging" Version="122.0.0" />
        <PackageReference Include="Xamarin.Google.Dagger" Version="2.39.1" />
        <PackageReference Include="Xamarin.GooglePlayServices.Base" Version="118.1.0" />
        <PackageReference Include="Xamarin.Firebase.Analytics" Version="121.1.1" />
        <PackageReference Include="Xamarin.GooglePlayServices.Analytics.Impl" Version="118.0.1" />
    </ItemGroup>
</Project>

Original Target (Removed):

    <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>

Replacement:

<LinkWithSwiftSystemLibraries>true</LinkWithSwiftSystemLibraries>

This line seems to replace the entire previous target with a simpler directive to link with Swift system libraries. https://github.com/xamarin/xamarin-macios/pull/20463

Please advise on any potential solutions or workarounds to resolve this issue. Thank you!

vhugogarcia commented 1 month ago

@gataflow you may be missing to add the package reference: https://www.nuget.org/packages/AdamE.Firebase.iOS.Installations

I made it work on my personal project without issues. Please, take a look at this Analytics project, it may provide some help: https://github.com/vhugogarcia/Plugin.Firebase/blob/feature/packages-ios-upgrade/src/Analytics/Analytics.csproj

AdamEssenmacher commented 1 month ago

Please let us know if adding Installations solves this specific problem.

gataflow commented 1 month ago

Hi @AdamEssenmacher ,Just a quick note to express my gratitude for your fantastic work on implementing Firebase support in MAUI.

However, I'm encountering a deployment issue. While simulator deployment works smoothly, deploying to a real device or trying a dot net publish hasn't been successful,after adding :

        <PackageReference Include="AdamE.Firebase.iOS.Installations" Version="10.24.0" />
        <PackageReference Include="AdamE.Firebase.iOS.Analytics" Version="10.24.0" />

Attached is a video and logs for reference. Any advice on next steps would be greatly appreciated.

Thanks again for your support!

Target _CopyResourcesToBundle:
  Skipping target "_CopyResourcesToBundle" because all output files are up-to-date with respect to the input files.
Target _WriteAppManifest:
  Skipping target "_WriteAppManifest" because all output files are up-to-date with respect to the input files.
Target _ExpandNativeReferences:
    /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8022/tools/msbuild/iOS/Xamarin.Shared.targets(146,3): warning : The directory '/Users/victorsanchez/Library/Caches/XamarinBuildDownload/GAppM-10.24.0/GoogleAppMeasurement-10.24.0/Frameworks' does not exist.
    /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8022/tools/msbuild/iOS/Xamarin.Shared.targets(146,3): warning : The directory '/Users/victorsanchez/Library/Caches/XamarinBuildDownload/FAnlytcs-10.24.0/FirebaseAnalytics-10.24.0/Frameworks' does not exist.
Done building target "_ExpandNativeReferences" in project "testadame.csproj".
Target _CreateAOTDedupAssembly:
  Skipping target "_CreateAOTDedupAssembly" because all output files are up-to-date with respect to the input files.
Target PrepareForILLink:
    Optimizing assemblies for size may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
Target _RunILLink:
  Skipping target "_RunILLink" because all output files are up-to-date with respect to the input files.
Target _InstallNameTool:
  Skipping target "_InstallNameTool" because it has no outputs.
Target _CompileNativeExecutable:
  Skipping target "_CompileNativeExecutable" because all output files are up-to-date with respect to the input files.
Target _LinkNativeExecutable:
    Tool xcrun execution started with arguments: clang++ -F /Users/victorsanchez/.nuget/packages/adame.firebase.ios.core/10.24.0/lib/net6.0-ios16.1/Firebase.Core.resources/FirebaseCore.xcframework/ios-arm64 -framework FirebaseCore -F /Users/victorsanchez/Projects/testadame/testadame -framework Foundation -F /Users/victorsanchez/Projects/testadame/testadame -framework UIKit -F /Users/victorsanchez/.nuget/packages/adame.firebase.ios.core/10.24.0/lib/net6.0-ios16.1/Firebase.Core.resources/GTMSessionFetcher.xcframework/ios-arm64 -framework GTMSessionFetcher -F /Users/victorsanchez/.nuget/packages/adame.firebase.ios.core/10.24.0/lib/net6.0-ios16.1/Firebase.Core.resources/GoogleDataTransport.xcframework/ios-arm64 -framework GoogleDataTransport -F /Users/victorsanchez/Projects/testadame/testadame -framework SystemConfiguration -F /Users/victorsanchez/Projects/testadame/testadame -framework CoreTelephony -F /Users/victorsanchez/.nuget/packages/adame.firebase.ios.core/10.24.0/lib/net6.0-ios16.1/Firebase.Core.resources/FBLPromises.xcframework/ios-arm64 -framework FBLPromises -F /Users/victorsanchez/.nuget/packages/adame.firebase.ios.core/10.24.0/lib/net6.0-ios16.1/Firebase.Core.resources/GoogleUtilities.xcframework/ios-arm64 -framework GoogleUtilities -F /Users/victorsanchez/Projects/testadame/testadame -framework Security -F /Users/victorsanchez/.nuget/packages/adame.firebase.ios.core/10.24.0/lib/net6.0-ios16.1/Firebase.Core.resources/nanopb.xcframework/ios-arm64 -framework nanopb -F /Users/victorsanchez/.nuget/packages/adame.firebase.ios.core/10.24.0/lib/net6.0-ios16.1/Firebase.Core.resources/leveldb.xcframework/ios-arm64 -framework leveldb -F /Users/victorsanchez/.nuget/packages/adame.firebase.ios.core/10.24.0/lib/net6.0-ios16.1/Firebase.Core.resources/FirebaseAppCheckInterop.xcframework/ios-arm64 -framework FirebaseAppCheckInterop -F /Users/victorsanchez/.nuget/packages/adame.firebase.ios.core/10.24.0/lib/net6.0-ios16.1/Firebase.Core.resources/FirebaseAuthInterop.xcframework/ios-arm64 -framework FirebaseAuthInterop -F /Users/victorsanchez/.nuget/packages/adame.firebase.ios.core/10.24.0/lib/net6.0-ios16.1/Firebase.Core.resources/FirebaseCoreExtension.xcframework/ios-arm64 -framework FirebaseCoreExtension -F /Users/victorsanchez/.nuget/packages/adame.firebase.ios.core/10.24.0/lib/net6.0-ios16.1/Firebase.Core.resources/FirebaseCoreInternal.xcframework/ios-arm64 -framework FirebaseCoreInternal -F /Users/victorsanchez/.nuget/packages/adame.firebase.ios.core/10.24.0/lib/net6.0-ios16.1/Firebase.Core.resources/FirebaseMessagingInterop.xcframework/ios-arm64 -framework FirebaseMessagingInterop -F /Users/victorsanchez/.nuget/packages/adame.firebase.ios.core/10.24.0/lib/net6.0-ios16.1/Firebase.Core.resources/FirebaseRemoteConfigInterop.xcframework/ios-arm64 -framework FirebaseRemoteConfigInterop -F /Users/victorsanchez/.nuget/packages/adame.firebase.ios.core/10.24.0/lib/net6.0-ios16.1/Firebase.Core.resources/FirebaseSharedSwift.xcframework/ios-arm64 -framework FirebaseSharedSwift -F /Users/victorsanchez/.nuget/packages/adame.firebase.ios.core/10.24.0/lib/net6.0-ios16.1/Firebase.Core.resources/Promises.xcframework/ios-arm64 -framework Promises -F /Users/victorsanchez/.nuget/packages/adame.firebase.ios.core/10.24.0/lib/net6.0-ios16.1/Firebase.Core.resources/FirebaseSessions.xcframework/ios-arm64 -framework FirebaseSessions -F /Users/victorsanchez/.nuget/packages/adame.firebase.ios.installations/10.24.0/lib/net6.0-ios16.1/Firebase.Installations.resources/FirebaseInstallations.xcframework/ios-arm64 -framework FirebaseInstallations -mios-version-min=11.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.2.sdk -arch arm64 /Users/victorsanchez/Projects/testadame/testadame/obj/Debug/net8.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.Private.CoreLib.dll.o /usr/local/share/dotnet/packs/Microsoft.iOS.Runtime.ios-arm64/17.2.8022/runtimes/ios-arm64/native/libxamarin-dotnet-debug.a /usr/local/share/dotnet/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/8.0.2/runtimes/ios-arm64/native/libSystem.Globalization.Native.a /usr/local/share/dotnet/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/8.0.2/runtimes/ios-arm64/native/libSystem.IO.Compression.Native.a /usr/local/share/dotnet/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/8.0.2/runtimes/ios-arm64/native/libSystem.Native.a /usr/local/share/dotnet/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/8.0.2/runtimes/ios-arm64/native/libSystem.Net.Security.Native.a /usr/local/share/dotnet/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/8.0.2/runtimes/ios-arm64/native/libSystem.Security.Cryptography.Native.Apple.a /usr/local/share/dotnet/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/8.0.2/runtimes/ios-arm64/native/libicudata.a /usr/local/share/dotnet/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/8.0.2/runtimes/ios-arm64/native/libicui18n.a /usr/local/share/dotnet/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/8.0.2/runtimes/ios-arm64/native/libicuuc.a /usr/local/share/dotnet/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/8.0.2/runtimes/ios-arm64/native/libmono-component-debugger-static.a /usr/local/share/dotnet/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/8.0.2/runtimes/ios-arm64/native/libmono-component-diagnostics_tracing-static.a /usr/local/share/dotnet/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/8.0.2/runtimes/ios-arm64/native/libmono-component-hot_reload-stub-static.a /usr/local/share/dotnet/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/8.0.2/runtimes/ios-arm64/native/libmono-component-marshal-ilgen-static.a /usr/local/share/dotnet/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/8.0.2/runtimes/ios-arm64/native/libmonosgen-2.0.a /usr/local/share/dotnet/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/8.0.2/runtimes/ios-arm64/native/libmono-component-debugger-static.a /usr/local/share/dotnet/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/8.0.2/runtimes/ios-arm64/native/libmono-component-diagnostics_tracing-static.a /usr/local/share/dotnet/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/8.0.2/runtimes/ios-arm64/native/libmono-component-marshal-ilgen-static.a /usr/local/share/dotnet/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/8.0.2/runtimes/ios-arm64/native/libmono-component-hot_reload-stub-static.a -framework Accelerate -framework Accounts -framework AddressBook -framework AddressBookUI -framework AdSupport -framework ARKit -framework AssetsLibrary -framework AudioToolbox -framework AVFoundation -framework AVKit -framework CallKit -framework CFNetwork -framework CloudKit -framework Contacts -framework ContactsUI -framework CoreAudioKit -framework CoreBluetooth -framework CoreData -framework CoreFoundation -framework CoreGraphics -framework CoreImage -framework CoreLocation -framework CoreMedia -framework CoreMIDI -framework CoreML -framework CoreMotion -framework CoreSpotlight -framework CoreTelephony -framework CoreText -framework CoreVideo -framework DeviceCheck -framework EventKit -framework EventKitUI -framework ExternalAccessory -framework FileProvider -framework FileProviderUI -framework Foundation -framework GameController -framework GameKit -framework GameplayKit -framework GLKit -framework HealthKit -framework HealthKitUI -framework HomeKit -framework IdentityLookup -framework ImageIO -framework Intents -framework IntentsUI -framework IOSurface -framework JavaScriptCore -framework LocalAuthentication -framework MapKit -framework MediaAccessibility -framework MediaPlayer -framework MediaToolbox -framework Messages -framework MessageUI -framework Metal -framework MetalKit -framework MetalPerformanceShaders -framework MobileCoreServices -framework ModelIO -framework MultipeerConnectivity -framework NetworkExtension -framework NotificationCenter -framework OpenGLES -framework PassKit -framework PDFKit -framework Photos -framework PhotosUI -framework PushKit -framework QuartzCore -framework QuickLook -framework ReplayKit -framework SafariServices -framework SceneKit -framework Security -framework Social -framework Speech -framework SpriteKit -framework StoreKit -framework SystemConfiguration -framework Twitter -framework UIKit -framework UserNotifications -framework UserNotificationsUI -framework VideoSubscriberAccount -framework VideoToolbox -framework Vision -framework WatchConnectivity -framework WebKit -weak_framework Accessibility -weak_framework AdServices -weak_framework AppClip -weak_framework AppTrackingTransparency -weak_framework AuthenticationServices -weak_framework AutomaticAssessmentConfiguration -weak_framework AVRouting -weak_framework BackgroundAssets -weak_framework BackgroundTasks -weak_framework BusinessChat -weak_framework CarPlay -weak_framework Cinematic -weak_framework ClassKit -weak_framework CoreHaptics -weak_framework CoreLocationUI -weak_framework CoreNFC -weak_framework IdentityLookupUI -weak_framework LinkPresentation -weak_framework MediaSetup -weak_framework MetalFX -weak_framework MetalPerformanceShadersGraph -weak_framework MetricKit -weak_framework MLCompute -weak_framework NaturalLanguage -weak_framework NearbyInteraction -weak_framework Network -weak_framework OSLog -weak_framework PencilKit -weak_framework PHASE -weak_framework PushToTalk -weak_framework QuickLookThumbnailing -weak_framework ScreenTime -weak_framework SensitiveContentAnalysis -weak_framework SensorKit -weak_framework SharedWithYou -weak_framework SharedWithYouCore -weak_framework ShazamKit -weak_framework SoundAnalysis -weak_framework Symbols -weak_framework ThreadNetwork -weak_framework UniformTypeIdentifiers -weak_framework VisionKit -framework GSS -framework CFNetwork -rpath @executable_path/Frameworks /Users/victorsanchez/Projects/testadame/testadame/obj/Debug/net8.0-ios/ios-arm64/nativelibraries/main.arm64.o /Users/victorsanchez/Projects/testadame/testadame/obj/Debug/net8.0-ios/ios-arm64/nativelibraries/registrar.o -o /Users/victorsanchez/Projects/testadame/testadame/obj/Debug/net8.0-ios/ios-arm64/nativelibraries/testadame -lcompression -dead_strip -lz -liconv -lcompression -lobjc -exported_symbols_list obj/Debug/net8.0-ios/ios-arm64/mtouch-symbols.list -Xlinker -ld_classic

    Tool xcrun execution finished (exit code = 1).

    Undefined symbols for architecture arm64:
      "_OBJC_CLASS_$_FIRAnalytics", referenced from:
          objc-class-ref in registrar.o
    ld: symbol(s) not found for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8022/targets/Xamarin.Shared.Sdk.targets(1559,3): error : clang++ exited with code 1:
    /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8022/targets/Xamarin.Shared.Sdk.targets(1559,3): error : Undefined symbols for architecture arm64:
    /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8022/targets/Xamarin.Shared.Sdk.targets(1559,3): error :   "_OBJC_CLASS_$_FIRAnalytics", referenced from:
    /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8022/targets/Xamarin.Shared.Sdk.targets(1559,3): error :       objc-class-ref in registrar.o
    /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8022/targets/Xamarin.Shared.Sdk.targets(1559,3): error : ld: symbol(s) not found for architecture arm64
    /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8022/targets/Xamarin.Shared.Sdk.targets(1559,3): error : clang: error: linker command failed with exit code 1 (use -v to see invocation)
Done building target "_LinkNativeExecutable" in project "testadame.csproj" -- FAILED.

Done building project "testadame.csproj" -- FAILED.

Build FAILED.

/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8022/tools/msbuild/iOS/Xamarin.Shared.targets(146,3): warning : The directory '/Users/victorsanchez/Library/Caches/XamarinBuildDownload/GAppM-10.24.0/GoogleAppMeasurement-10.24.0/Frameworks' does not exist.
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8022/tools/msbuild/iOS/Xamarin.Shared.targets(146,3): warning : The directory '/Users/victorsanchez/Library/Caches/XamarinBuildDownload/FAnlytcs-10.24.0/FirebaseAnalytics-10.24.0/Frameworks' does not exist.
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8022/targets/Xamarin.Shared.Sdk.targets(1559,3): error : clang++ exited with code 1:
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8022/targets/Xamarin.Shared.Sdk.targets(1559,3): error : Undefined symbols for architecture arm64:
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8022/targets/Xamarin.Shared.Sdk.targets(1559,3): error :   "_OBJC_CLASS_$_FIRAnalytics", referenced from:
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8022/targets/Xamarin.Shared.Sdk.targets(1559,3): error :       objc-class-ref in registrar.o
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8022/targets/Xamarin.Shared.Sdk.targets(1559,3): error : ld: symbol(s) not found for architecture arm64
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8022/targets/Xamarin.Shared.Sdk.targets(1559,3): error : clang: error: linker command failed with exit code 1 (use -v to see invocation)
    2 Warning(s)
    1 Error(s)

Time Elapsed 00:00:02.38

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Build: 1 error, 2 warnings

https://github.com/AdamEssenmacher/GoogleApisForiOSComponents/assets/19789631/51b1feb1-f3e2-4554-a2f7-8a28950c7abf

vhugogarcia commented 1 month ago

@gataflow don't remove the Target you said you removed, please put it back. I was able to build, and debug on physical devices without issues. Also, it worked on release mode when sending it to TestFlight for QA. Please the Target back:

<!-- 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>

And remove this from your csproj: <LinkWithSwiftSystemLibraries>true</LinkWithSwiftSystemLibraries>

gataflow commented 1 month ago

reintroduced the target name linkwithswift and removed this from the csproj: ```

true``` ![image](https://github.com/AdamEssenmacher/GoogleApisForiOSComponents/assets/19789631/4eb16311-d0cc-4355-bce6-a50765ff309e) running an Azure Pipeline ``` - task: Bash@3 displayName: 'Build ios app' inputs: targetType: 'inline' script: | cd C.Mobile/ dotnet publish C.Mobile.csproj -f $(iOSVersion) -c $(BuildConfiguration) -p:BuildIpa=True /p:RuntimeIdentifier=ios-arm64 /p:EnableAssemblyripping=false ``` ``` 2024-05-01T15:40:29.9735700Z Tool xcrun execution finished (exit code = 1). 2024-05-01T15:40:29.9740470Z 2024-05-01T15:40:29.9991990Z ld: warning: Could not find or use auto-linked framework 'GoogleAppMeasurement' 2024-05-01T15:40:29.9993350Z Undefined symbols for architecture arm64: 2024-05-01T15:40:29.9994460Z "_APMAnalyticsConfiguration", referenced from: 2024-05-01T15:40:29.9996270Z +[FIRAnalytics startWithConfiguration:options:] in FirebaseAnalytics(FIRAnalytics.o) 2024-05-01T15:40:29.9997250Z "_APMAppMeasurementOriginFirebase", referenced from: 2024-05-01T15:40:29.9997970Z +[FIRAnalytics startWithConfiguration:options:] in FirebaseAnalytics(FIRAnalytics.o) 2024-05-01T15:40:29.9998870Z "_APMConsentSettings3P", referenced from: 2024-05-01T15:40:29.9999710Z +[FIRAnalytics setConsent:] in FirebaseAnalytics(FIRAnalytics.o) 2024-05-01T15:40:30.0000300Z "_APMFormattedEventName", referenced from: 2024-05-01T15:40:30.0001020Z +[FIRAnalytics logEventWithOrigin:name:parameters:] in FirebaseAnalytics(FIRAnalytics.o) 2024-05-01T15:40:30.0071680Z "_APMFormattedUserPropertyName", referenced from: 2024-05-01T15:40:30.0072140Z +[FIRAnalytics setUserPropertyString:forName:] in FirebaseAnalytics(FIRAnalytics.o) 2024-05-01T15:40:30.0073380Z "_APMIsAnalyticsCollectionDeactivated", referenced from: 2024-05-01T15:40:30.0074310Z +[FIRAnalytics startWithConfiguration:options:] in FirebaseAnalytics(FIRAnalytics.o) 2024-05-01T15:40:30.0074650Z "_APMIsAnalyticsCollectionEnabled", referenced from: 2024-05-01T15:40:30.0075370Z +[FIRAnalytics startWithConfiguration:options:] in FirebaseAnalytics(FIRAnalytics.o) 2024-05-01T15:40:30.0075740Z "_APMMonitorLogTagOptionKey", referenced from: 2024-05-01T15:40:30.0076100Z +[FIRAnalytics startWithConfiguration:options:] in FirebaseAnalytics(FIRAnalytics.o) 2024-05-01T15:40:30.0076480Z "_APMUserDataFieldEmailAddress", referenced from: 2024-05-01T15:40:30.0076870Z +[FIRAnalytics initiateOnDeviceConversionMeasurementWithEmailAddress:] in FirebaseAnalytics(FIRAnalytics.o) 2024-05-01T15:40:30.0077340Z "_APMUserDataFieldHashedEmailAddress", referenced from: 2024-05-01T15:40:30.0077760Z +[FIRAnalytics initiateOnDeviceConversionMeasurementWithHashedEmailAddress:] in FirebaseAnalytics(FIRAnalytics.o) 2024-05-01T15:40:30.0078960Z "_APMUserDataFieldHashedPhoneNumber", referenced from: 2024-05-01T15:40:30.0079390Z +[FIRAnalytics initiateOnDeviceConversionMeasurementWithHashedPhoneNumber:] in FirebaseAnalytics(FIRAnalytics.o) 2024-05-01T15:40:30.0079780Z "_APMUserDataFieldPhoneNumber", referenced from: 2024-05-01T15:40:30.0080150Z +[FIRAnalytics initiateOnDeviceConversionMeasurementWithPhoneNumber:] in FirebaseAnalytics(FIRAnalytics.o) 2024-05-01T15:40:30.0080530Z "_OBJC_CLASS_$_APMAdExposureReporter", referenced from: 2024-05-01T15:40:30.0080850Z _OBJC_CLASS_$_FIRAAdExposureReporter in FirebaseAnalytics(FIRAAdExposureReporter.o) 2024-05-01T15:40:30.0081200Z "_OBJC_CLASS_$_APMAnalytics", referenced from: 2024-05-01T15:40:30.0082250Z objc-class-ref in FirebaseAnalytics(FIRAnalytics.o) 2024-05-01T15:40:30.0082830Z "_OBJC_CLASS_$_APMConditionalUserProperty", referenced from: 2024-05-01T15:40:30.0083530Z _OBJC_CLASS_$_FIRAConditionalUserProperty in FirebaseAnalytics(FIRAConditionalUserProperty.o) 2024-05-01T15:40:30.0084060Z "_OBJC_CLASS_$_APMConditionalUserPropertyController", referenced from: 2024-05-01T15:40:30.0084490Z _OBJC_CLASS_$_FIRAConditionalUserPropertyController in FirebaseAnalytics(FIRAConditionalUserPropertyController.o) 2024-05-01T15:40:30.0084870Z "_OBJC_CLASS_$_APMEvent", referenced from: 2024-05-01T15:40:30.0085140Z _OBJC_CLASS_$_FIRAEvent in FirebaseAnalytics(FIRAEvent.o) 2024-05-01T15:40:30.0085460Z "_OBJC_CLASS_$_APMIdentifiers", referenced from: 2024-05-01T15:40:30.0085790Z _OBJC_CLASS_$_FIRAIdentifiers in FirebaseAnalytics(FIRAIdentifiers.o) 2024-05-01T15:40:30.0086120Z "_OBJC_CLASS_$_APMIdentity", referenced from: 2024-05-01T15:40:30.0086530Z objc-class-ref in FirebaseAnalytics(FIRAnalytics.o) 2024-05-01T15:40:30.0086840Z "_OBJC_CLASS_$_APMMeasurement", referenced from: 2024-05-01T15:40:30.0087190Z objc-class-ref in FirebaseAnalytics(FIRAnalytics.o) 2024-05-01T15:40:30.0087600Z objc-class-ref in FirebaseAnalytics(FIRAMeasurement.o) 2024-05-01T15:40:30.0088120Z _OBJC_CLASS_$_FIRAMeasurement in FirebaseAnalytics(FIRAMeasurement.o) 2024-05-01T15:40:30.0088840Z "_OBJC_CLASS_$_APMScreenViewReporter", referenced from: 2024-05-01T15:40:30.0089310Z objc-class-ref in FirebaseAnalytics(FIRAScreenViewReporter.o) 2024-05-01T15:40:30.0089680Z _OBJC_CLASS_$_FIRAScreenViewReporter in FirebaseAnalytics(FIRAScreenViewReporter.o) 2024-05-01T15:40:30.0090030Z "_OBJC_CLASS_$_APMUserAttribute", referenced from: 2024-05-01T15:40:30.0090330Z _OBJC_CLASS_$_FIRAUserAttribute in FirebaseAnalytics(FIRAUserAttribute.o) 2024-05-01T15:40:30.0091040Z "_OBJC_CLASS_$_APMValue", referenced from: 2024-05-01T15:40:30.0091610Z _OBJC_CLASS_$_FIRAValue in FirebaseAnalytics(FIRAValue.o) 2024-05-01T15:40:30.0091930Z "_OBJC_METACLASS_$_APMAdExposureReporter", referenced from: 2024-05-01T15:40:30.0092270Z _OBJC_METACLASS_$_FIRAAdExposureReporter in FirebaseAnalytics(FIRAAdExposureReporter.o) 2024-05-01T15:40:30.0092650Z "_OBJC_METACLASS_$_APMConditionalUserProperty", referenced from: 2024-05-01T15:40:30.0093140Z _OBJC_METACLASS_$_FIRAConditionalUserProperty in FirebaseAnalytics(FIRAConditionalUserProperty.o) 2024-05-01T15:40:30.0093540Z "_OBJC_METACLASS_$_APMConditionalUserPropertyController", referenced from: 2024-05-01T15:40:30.0093940Z _OBJC_METACLASS_$_FIRAConditionalUserPropertyController in FirebaseAnalytics(FIRAConditionalUserPropertyController.o) 2024-05-01T15:40:30.0094320Z "_OBJC_METACLASS_$_APMEvent", referenced from: 2024-05-01T15:40:30.0094630Z _OBJC_METACLASS_$_FIRAEvent in FirebaseAnalytics(FIRAEvent.o) 2024-05-01T15:40:30.0095270Z "_OBJC_METACLASS_$_APMIdentifiers", referenced from: 2024-05-01T15:40:30.0095620Z _OBJC_METACLASS_$_FIRAIdentifiers in FirebaseAnalytics(FIRAIdentifiers.o) 2024-05-01T15:40:30.0102630Z "_OBJC_METACLASS_$_APMMeasurement", referenced from: 2024-05-01T15:40:30.0103900Z _OBJC_METACLASS_$_FIRAMeasurement in FirebaseAnalytics(FIRAMeasurement.o) 2024-05-01T15:40:30.0104690Z "_OBJC_METACLASS_$_APMScreenViewReporter", referenced from: 2024-05-01T15:40:30.0105300Z _OBJC_METACLASS_$_FIRAScreenViewReporter in FirebaseAnalytics(FIRAScreenViewReporter.o) 2024-05-01T15:40:30.0106660Z "_OBJC_METACLASS_$_APMUserAttribute", referenced from: 2024-05-01T15:40:30.0108070Z _OBJC_METACLASS_$_FIRAUserAttribute in FirebaseAnalytics(FIRAUserAttribute.o) 2024-05-01T15:40:30.0108980Z "_OBJC_METACLASS_$_APMValue", referenced from: 2024-05-01T15:40:30.0109630Z _OBJC_METACLASS_$_FIRAValue in FirebaseAnalytics(FIRAValue.o) 2024-05-01T15:40:30.0110240Z ld: symbol(s) not found for architecture arm64 2024-05-01T15:40:30.0111490Z clang: error: linker command failed with exit code 1 (use -v to see invocation) 2024-05-01T15:40:30.0111850Z ```
AdamEssenmacher commented 1 month ago

The two lines from the build log that are most concerning:

warning : The directory '/Users/victorsanchez/Library/Caches/XamarinBuildDownload/GAppM-10.24.0/GoogleAppMeasurement-10.24.0/Frameworks' does not exist.
warning : The directory '/Users/victorsanchez/Library/Caches/XamarinBuildDownload/FAnlytcs-10.24.0/FirebaseAnalytics-10.24.0/Frameworks' does not exist.

It won't be able to link to binaries that don't exist.

Try running a nuget restore first.

gataflow commented 1 month ago

Thanks a bunch for the guidance on running dotnet restore. sorted it, I'm all set to deploy to a real iPhone and smoothly build on an Azure pipeline. Really appreciate your help!

vhugogarcia commented 1 month ago

Glad it worked @gataflow . Please give us a hand closing this issue if you believe it has been resolved.

Thanks in advance 😃