Xamarin.iOS getting issues with OneSignal when deploying

292 views Asked by At

I am having an issue integrating OneSignal with my Xamarin.IOS app. I create and app from scratch and then follow the sdk guide on their website, however, after adding the SDK once I try and deploy to my apple device I get the below error.

This does not happen when deploying to a simulator and I have tried two different Apple Devices.

Error Screenshot

Update

The issue seemed to be with my version of the mono framework. I was using Visual studio for mac preview which uses mono version 4.8, however, this is still in the alpha branch.

I then used Xamarin Studio and downgrade mono to 4.6 (Stable Build) and everything worked fine.

1

There are 1 answers

1
PlusInfosys On BEST ANSWER

It seems you are using OSNotificationPayload class from iOS native library (.a file). The error means that library is not loaded for the current architecture. As its working on Simulator, .a is for simulator only.

You can verify this using Lipo command:

 lipo -info YourLibrary.a

Get .a file for device and simulator both and generate fat library from it and use it. It will resolve your problem.

here is command to create universal FAT library - copied from here:

lipo -create -output libMyLibrary.a libMyLibrary-i386.a libMyLibrary-arm64.a libMyLibrary-armv7.a