Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build errors in .NET 8 for iOS related to PPRiskMagnes package #27

Open
mickbyrne opened this issue Oct 21, 2024 · 9 comments
Open

Build errors in .NET 8 for iOS related to PPRiskMagnes package #27

mickbyrne opened this issue Oct 21, 2024 · 9 comments

Comments

@mickbyrne
Copy link

I'm getting build errors when using these .NET 8 Braintree bindings which appear to be related to the PPRiskMagnes framework. During the build, there's a warning that reads:

0>PPRiskMagnes: Warning MT7091 : The framework /Users/mick/Library/Caches/XamarinBuildDownload/PPRiskMagnes-5.4.0.24/PPRiskMagnes.xcframework/ios-arm64_x86_64-simulator/PPRiskMagnes.framework is a framework of static libraries, and will not be copied to the app.

This is immediately followed by this error:

Tool xcrun execution finished (exit code = 1).
        
0>Xamarin.Shared.Sdk.targets(1641,3): Error  : clang++ exited with code 1:
Undefined symbols for architecture arm64:
  "_$s12CoreGraphics7CGFloatVMn", referenced from:
      _symbolic _____ 12CoreGraphics7CGFloatV in PPRiskMagnes(TouchDataCollector.o)
  "_$s12CoreGraphics7CGFloatVN", referenced from:
      _$s12PPRiskMagnes17CoreDataCollectorC13getScreenInfo33_DF872FAC5B209B23227CF2AE9292ED8BLLSDySSypGyFTf4d_n in PPRiskMagnes(CoreDataCollector.o)
      _$s12PPRiskMagnes20DynamicDataCollectorC13getScreenInfo33_6D1A8B8433CB222B9D56A714BE413FCFLLSDySSypGyFTf4d_n in PPRiskMagnes(DynamicDataCollector.o)
      _$s12CoreGraphics7CGFloatVACs7CVarArgAAWl in PPRiskMagnes(DynamicDataCollector.o)
  "_$s12CoreGraphics7CGFloatVs7CVarArgAAMc", referenced from:
      _$s12CoreGraphics7CGFloatVACs7CVarArgAAWl in PPRiskMagnes(DynamicDataCollector.o)
  "_$s15_ObjectiveCTypes01_A11CBridgeablePTl", referenced from:
      l_got.$s15_ObjectiveCTypes01_A11CBridgeablePTl in PPRiskMagnes(MagnesSensorDataCollector.o)
  "_$s8AllCasess12CaseIterablePTl", referenced from:
      l_got.$s8AllCasess12CaseIterablePTl in PPRiskMagnes(MagnesConstants.o)
  "_$s8Dispatch0A12TimeIntervalO7secondsyACSicACmFWC", referenced from:
      _$s12PPRiskMagnes18TouchDataCollectorC14touchBeganTime33_2DD6F9C76A9A39ACDA65F95464D52074LLs5Int64VSgvW in PPRiskMagnes(TouchDataCollector.o)
  "_$s8Dispatch0A12TimeIntervalOMa", referenced from:
      _$s12PPRiskMagnes18TouchDataCollectorC14touchBeganTime33_2DD6F9C76A9A39ACDA65F95464D52074LLs5Int64VSgvW in PPRiskMagnes(TouchDataCollector.o)
  "_$s8Dispatch0A13WorkItemFlagsVMa", referenced from:
      _$s12PPRiskMagnes18AuditDataCollectorC016collectAndSubmitcD026withPaypalClientMetadataIdySS_tF in PPRiskMagnes(AuditDataCollector.o)
      _$s8Dispatch0A13WorkItemFlagsVACs10SetAlgebraAAWl in PPRiskMagnes(AuditDataCollector.o)
      _$s12PPRiskMagnes18TouchDataCollectorC14touchBeganTime33_2DD6F9C76A9A39ACDA65F95464D52074LLs5Int64VSgvW in PPRiskMagnes(TouchDataCollector.o)
      _$s12PPRiskMagnes18TouchDataCollectorC13sendToBackend33_2DD6F9C76A9A39ACDA65F95464D52074LLyyF in PPRiskMagnes(TouchDataCollector.o)
      _$s12PPRiskMagnes20DynamicDataCollectorC23generateUserAgentStringyyF in PPRiskMagnes(DynamicDataCollector.o)
      _$s12PPRiskMagnes22TelemetryDataCollectorC13sendToBackend33_5CB73408D6CF791273C3357C6A441308LL6resultyAC0cD6ResultAELLC_tF in PPRiskMagnes(TelemetryDataCollector.o)
      _$s12PPRiskMagnes0B19SensorDataCollectorC5setUp12withFreqRateySf_tF in PPRiskMagnes(MagnesSensorDataCollector.o)
0>------- Finished building project: ALDImobile.iOS. Succeeded: False. Errors: 1. Warnings: 804

PS We love your work here, keep it up!

@wayousuf
Copy link

I am experiencing the same issue. I tested it using the sample project and encountered the same problem, which seems to be related to PPRiskMagnes. As a result, I am unable to build the iOS project.

@wayousuf
Copy link

wayousuf commented Nov 26, 2024

@mickbyrne, have you found any workaround?

@mickbyrne
Copy link
Author

@wayousuf no, not as yet. I think we're going to have to just fork these bindings or do them all ourselves.

@tuyen-vuduc
Copy link
Contributor

Great to hear that the libraries are in use.

I am no longer having time to check and/or do the upgrade.

Feel free to fork/update then create PR.

We all contribute to the community.

Regards.

@mickbyrne
Copy link
Author

@tuyen-vuduc thanks for the update. We understand how time consuming this kind of work can be. Thanks for all your efforts over the years on this SDK (and Mapbox!)

@mickbyrne
Copy link
Author

@wayousuf (and may be of interest to @tuyen-vuduc), we were eventually able to get this working by adding a bunch of additional properties in the .csproj file to ensure a number of the dependencies were linked properly.

First, to fix the problem with the PPRiskMagnes package, in the top-level <PropertyGroup> element we added:

<LinkWithSwiftSystemLibraries>true</LinkWithSwiftSystemLibraries>
<MtouchExtraArgs>--gcc_flags "-ObjC -all_load"</MtouchExtraArgs>

Then to get the KountDataCollector package we added the following <ItemGroup> elements (one for the simulator, one for physical devices):

	<ItemGroup Condition="'$(RuntimeIdentifier)'=='ios-arm64'">
		<!-- Version number here must be manually updated to match the KountDataCollector.iOS PackageReference below -->
		<NativeReference Include="$(XamarinBuildDownloadDir)/KountDataCollector-4.1.5.24/KountDataCollector.xcframework/ios-arm64_armv7/libKountDataCollector.a">
			<Kind>Static</Kind>
			<ForceLoad>true</ForceLoad>
		</NativeReference>
	</ItemGroup>
	<ItemGroup Condition="'$(RuntimeIdentifier)'!='ios-arm64'">
		<!-- Version number here must be manually updated to match the KountDataCollector.iOS PackageReference below -->
		<NativeReference Include="$(XamarinBuildDownloadDir)/KountDataCollector-4.1.5.24/KountDataCollector.xcframework/ios-arm64_x86_64-simulator/libKountDataCollector.a">
			<Kind>Static</Kind>
			<ForceLoad>true</ForceLoad>
		</NativeReference>
	</ItemGroup>
	<ItemGroup>
		<PackageReference Include="KountDataCollector.iOS" Version="4.1.5.24"/>
		<PackageReference Include="BraintreeApplePay.iOS" Version="5.12.0.24"/>
		<PackageReference Include="BraintreeCard.iOS" Version="5.12.0.24"/>
		<PackageReference Include="BraintreeCore.iOS" Version="5.12.0.24"/>
		<PackageReference Include="BraintreeDataCollector.iOS" Version="5.12.0.24"/>
		<PackageReference Include="BraintreeDropIn.iOS" Version="9.7.0.24"/>
		<PackageReference Include="BraintreePaymentFlow.iOS" Version="5.12.0.24"/>
		<PackageReference Include="BraintreePayPal.iOS" Version="5.12.0.24"/>
		<PackageReference Include="BraintreeThreeDSecure.iOS" Version="5.12.0.24"/>
		<PackageReference Include="BraintreeUnionPay.iOS" Version="5.12.0.24"/>
		<PackageReference Include="BraintreeVenmo.iOS" Version="5.12.0.24"/>
	</ItemGroup>

Good luck!

@tuyen-vuduc
Copy link
Contributor

@mickbyrne That's a great insight. Might you try removing/adding to find out if only the flag is needed?

@mickbyrne
Copy link
Author

@tuyen-vuduc we tried a bunch of things already. Everything in those snippets is required to get it to work.

@tuyen-vuduc
Copy link
Contributor

tuyen-vuduc commented Dec 2, 2024

These conditions used to work well. It looks like $(Platform) was changed.

<NativeReference Condition=" $(Platform) == 'iPhoneSimulator' " Include="$(_KountDataCollectorSDKBaseFolder)KountDataCollector.xcframework/ios-arm64_x86_64-simulator/libKountDataCollector.a">
  <Kind>Static</Kind>
  <SmartLink>True</SmartLink>
  <ForceLoad>True</ForceLoad>
</NativeReference>
<NativeReference Condition=" $(Platform) == 'iPhone' " Include="$(_KountDataCollectorSDKBaseFolder)KountDataCollector.xcframework/ios-arm64_armv7/libKountDataCollector.a">
  <Kind>Static</Kind>
  <SmartLink>True</SmartLink>
  <ForceLoad>True</ForceLoad>
</NativeReference>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants