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

[Help wanted] Update to 3.6.3 and beyond (+xcframework) #7

Open
beeradmoore opened this issue Jan 10, 2022 · 4 comments
Open

[Help wanted] Update to 3.6.3 and beyond (+xcframework) #7

beeradmoore opened this issue Jan 10, 2022 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@beeradmoore
Copy link
Owner

I've hit a bit of a wall with v3.6.3 (also v3.6.4 and later).

This was about the time Xcode 11 came out and the code is now distributed as a .xcframework rather than a .framework (or something along these lines). This required some updates in carthage to get functional but it now appears it is.

I have put my work in progress code on the bugfix/xcframework repo. The main changes are updating build scripts to use Mixpanel v3.6.3 and FetchFrameworks.sh now calls carthage like this:

carthage update --use-xcframeworks --platform ios

The Mixpanel.xcframework appears to be copied into the build and appears to be in the nuget (based on the fact its filesize is now 10mb). But when you try run this in the example project you will get the following errors:

~/git/beeradmoore/Xam.Plugin.Mixpanel.iOS/Example/Main.cs(12,13,12,58): warning CS0618: 'UIApplication.Main(string[]?, string?, string?)' is obsolete: 'Use the overload with 'Type' instead of 'String' parameters for type safety.'
MTOUCH : warning MT5215: References to 'System' might require additional -framework=XXX or -lXXX instructions to the native linker
MTOUCH : warning MT5215: References to 'System' might require additional -framework=XXX or -lXXX instructions to the native linker
MTOUCH : warning MT5215: References to 'System.Net.Security' might require additional -framework=XXX or -lXXX instructions to the native linker
MTOUCH : warning MT5215: References to 'System' might require additional -framework=XXX or -lXXX instructions to the native linker
MTOUCH : error MT5214: Native linking failed, undefined symbol: _MPNotificationTypeMini. This symbol was referenced by the managed member Xam.Plugin.Mixpanel.iOS.Constants.MPNotificationTypeMini. Please verify that all the necessary frameworks have been referenced and native libraries linked.
MTOUCH : error MT5214: Native linking failed, undefined symbol: _MPNotificationTypeTakeover. This symbol was referenced by the managed member Xam.Plugin.Mixpanel.iOS.Constants.MPNotificationTypeTakeover. Please verify that all the necessary frameworks have been referenced and native libraries linked.
MTOUCH : error MT5211: Native linking failed, undefined Objective-C class: MPTweak. The symbol '_OBJC_CLASS_$_MPTweak' could not be found in any of the libraries or frameworks linked with your application.
MTOUCH : error MT5211: Native linking failed, undefined Objective-C class: MPTweakStore. The symbol '_OBJC_CLASS_$_MPTweakStore' could not be found in any of the libraries or frameworks linked with your application.
MTOUCH : error MT5211: Native linking failed, undefined Objective-C class: Mixpanel. The symbol '_OBJC_CLASS_$_Mixpanel' could not be found in any of the libraries or frameworks linked with your application.
MTOUCH : error MT5211: Native linking failed, undefined Objective-C class: MixpanelGroup. The symbol '_OBJC_CLASS_$_MixpanelGroup' could not be found in any of the libraries or frameworks linked with your application.
MTOUCH : error MT5211: Native linking failed, undefined Objective-C class: MixpanelPeople. The symbol '_OBJC_CLASS_$_MixpanelPeople' could not be found in any of the libraries or frameworks linked with your application.
MTOUCH : error MT5211: Native linking failed, undefined Objective-C class: _MPTweakBindObserver. The symbol '_OBJC_CLASS_$__MPTweakBindObserver' could not be found in any of the libraries or frameworks linked with your application.
MTOUCH : error MT5202: Native linking failed. Please review the build log.
clang : error : linker command failed with exit code 1 (use -v to see invocation)

There is also some unknowns about this that I am not sure of. If we use --platform ios then how do we build this for watchOS and tvOS? Can all these be bundled in the same nuget or do we now need a Xam.Plugin.Mixpanel.tvOS and Xam.Plugin.Mixpanel.watchOS as seperate bundles?

@beeradmoore beeradmoore added the help wanted Extra attention is needed label Jan 10, 2022
@beeradmoore
Copy link
Owner Author

I did just find this repo as well as this issue thread which may be of use.

@Lelelo1
Copy link

Lelelo1 commented Jan 27, 2022

As far as I understand that .xcframework is precompiled supporting all apple architectures and platforms.

The support in Xamarin for it seem to have come in with: xamarin/xamarin-macios#10046. But here there is mentioning it not working at the end.

I wonder if other platforms are even supported other than iOS natively if you run project it in Xcode. It could be that Mixpanel sdk does not support .xcframework?

@beeradmoore
Copy link
Owner Author

From memory all the other platforms and architectures are there when I do the pulling of xcframework via Carthage so I think it's there, so I assume it does support it. But I also have very limited knowledge of how any of these build systems all work together.

As for the link, yeah it seems a lot of riding people say "oh do this and this" and then threads go idle with "yeah that doesn't work". Ill try repro this one specifically and go post over in xamarin-macios repo incase its a tooling issue.

@beeradmoore
Copy link
Owner Author

Might be worth using the swift package with a proxy. NukeProxy may be something useful to examine how proxy library is made and how to bind things in fat bundles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants