OneSignal / OneSignal-Xamarin-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Xamarin app with OneSignal. https://onesignal.com
Other
105 stars 50 forks source link

Onesignal 3.10.5 Xamarin Application fails to compile with Xamarin iOS 14.10 and XCode v12.4 #234

Closed dhiraj-shetty closed 2 years ago

dhiraj-shetty commented 3 years ago

Description:

Onesignal 3.10.5 fails to compile with Xamarin iOS 14.10 and XCode v12.4

MTOUCH : error MT2101: Can't resolve the reference 'System.Void ObjCRuntime.ThrowHelper::ThrowArgumentNullException(System.String)', referenced from the method 'System.Void Com.OneSignal.iOS.OneSignal::AddTrigger(System.String,Foundation.NSObject)' in 'Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'.

Please note that the same code works well with our Xamarin.Android 11.1 We are not only able to compile but also receive notifications sent.

Please guide.

Environment

Steps to Reproduce Issue: Build using Appcenter Build with configuration shared above.

Anything else:

copang commented 3 years ago

Hi, Maybe I'm getting the same error. I use AppCenter to build for iOS (Xamarin.iOS 14.0 & XCode 12.0.1), my app crashes right after the splash screen, here is the log: Unhandled Exception: System.MissingMethodException: Method not found: void ObjCRuntime.ThrowHelper.ThrowArgumentNullException(string) at Com.OneSignal.OneSignalImplementation.Init (System.String appId, System.Boolean autoPrompt, System.Boolean inAppLaunchURLs, Com.OneSignal.Abstractions.OSInFocusDisplayOption displayOption, Com.OneSignal.Abstractions.LOG_LEVEL logLevel, Com.OneSignal.Abstractions.LOG_LEVEL visualLevel) [0x00049] in /Users/josh/Documents/release-repos/OneSignal-Xamarin-SDK/Com.OneSignal.iOS/OneSignalImplementation.cs:120 at Com.OneSignal.OneSignalImplementation.InitPlatform () [0x0006b] in /Users/josh/Documents/release-repos/OneSignal-Xamarin-SDK/Com.OneSignal.iOS/OneSignalImplementation.cs:107 at Com.OneSignal.Abstractions.XamarinBuilder.EndInit () [0x00000] in /Users/josh/Documents/release-repos/OneSignal-Xamarin-SDK/Com.OneSignal.Abstractions/XamarinBuilder.cs:68 at NTC.App..ctor () [0x003e3] in /Users/runner/work/1/s/NTC/App.xaml.cs:404 at NTC.iOS.AppDelegate.Finish<\M-b\M^@\M-&>

dhiraj-shetty commented 3 years ago

Thank you copang.

Requesting the Onesignal team to give this due importance. Or atleast a workaround.

softsan commented 3 years ago

same issue here even in my local in debug mode. Can't compile

jfishman1 commented 3 years ago

Hi @softsan @dhiraj-shetty @copang we have had reports that downgrading to nuget package 3.9.0 resolves this. We will look into this and see what changed to fix it in our next release.

tanaynigam commented 2 years ago

@dhiraj-shetty We have a release OneSignalSDK.Xamarin-4.0.0 in which this issue no longer seems to exist.

Please note that we have changed the package name and namespace for the SDK from Com.OneSignal to OneSignalSDK.Xamarin and would require you to remove the previous package name and add the new package name to import the SDK in your code.

Additionally, when searching for the package on nuget.org, you will be required to search for OneSignalSDK.Xamarin to import the package