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

NullReferenceException in RegisterLicense on Xamarin.iOS #322

Open
rbakhshi opened this issue Jun 21, 2023 · 1 comment
Open

NullReferenceException in RegisterLicense on Xamarin.iOS #322

rbakhshi opened this issue Jun 21, 2023 · 1 comment

Comments

@rbakhshi
Copy link

After upgrading to 3.0.15 our iOS app crashed with following stack trace:

System.NullReferenceException: Object reference not set to an instance of an object
   at Newtonsoft.Json.Schema.Infrastructure.Licensing.LicenseHelpers.RegisterLicense(string license)
   at Newtonsoft.Json.Schema.License.RegisterLicense(string license)
   at Company.App.SetupLicenses()

Please note: the actual license string is not null or empty. The code in SetupLicenses verifies that before calling RegisterLicense.

Looking at the code I suspect something to do with reflection related code when trying to get the Assembly or Attribute on iOS.

Please note on iOS the production Xamarin app runs with JIT-ed .NET code and assemblies stripped down to only declarations.

Downgrading to 3.0.14 solved the issue for now.

@rbakhshi rbakhshi changed the title NullPointer exception in RegisterLicense on Xamarin.iOS NullReferenceException in RegisterLicense on Xamarin.iOS Jun 21, 2023
@JamesNK
Copy link
Owner

JamesNK commented Jun 21, 2023

I'm not sure what could cause that error. This is the difference in changes that happened between 3.0.14 and 3.0.15: 3.0.14...3.0.15

There were no changes to the License or LicenseHelpers types.

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

2 participants