I'm trialing telerik maui controls and got this issue specific to iOS.
The app launches, an alert dialog injected by telerik is shown with the "this is a trial" information.
when dismissing the alert, the app crashes:
[0:] An error occurred: 'Object reference not set to an instance of an object.'. Callstack: ' at Telerik.Maui.Controls.TelerikLicense.<>c__DisplayClass12_0.<ShowLicenseMessage>b__1()
any ideas?
it works fine on windows and android, just iOS keeps failing and stopping me from validating telerik controls.
####EDIT####
I've managed to reproduce this issue on a separate project.
- Created a new default maui project in visual studio for windows.
- added the telerik trial 10.0 package, updated maui to 9.0.40
- Added a new blank ContentPage called Loading.xaml. changed nothing on it.
- In app.xaml.cs, modified the `CreateWindow method to `return new Window(new Loading());` as we're not using Shell.
- Added another new ContentPage called PageWithTelerik.xaml
- on that page, simply added a telerik RadButton, which should trigger the trial popup.
- <telerik:RadButton x:Name="button" Text="Click me!" />
- back on app.xaml.cs, overridden the OnStart() method:
protected override void OnStart()
{
var mainPage = Application.Current.Windows[0].Page;
if (mainPage is Loading)
{
Page target = new PageWithTelerik();
MainThread.BeginInvokeOnMainThread(() => { Application.Current.Windows[0].Page = target; });
}
}
if you then run this app, it'll:
- get to PageWithTelerik
- display the trial popup (but the watermark that is usually is shown behind the popup is not visible!)
- crash with a null reference exception when you dismiss the popup.
Hi Luis,
I tested the scenario and cannot reproduce the exception. These are the steps I did:
1. Downloaded the .pkg file of the Telerik MAUI 10.0.0 trial version from my Telerik account
2. Installed the .pkg
3. Opened the SDK Browser app in visual studio code for mac
4. Build and run on MacCatalyst - the app works as expected when I close the trial popup
5. Build and run on iOS - same, the app works when closing the trial popup message.
Images are attached.
Let me know what are the steps you use to reproduce the behavior? Also send a sample app and the full stack-trace of the exception.
I'm experiencing the same issue, but on an Android device using Telerik MAUI 10.0.0 trial version.
The moment I dismiss the Trial Info popup, an exception is thrown and the app crashes.
System.ObjectDisposedExceptionException:
Message=Cannot access a disposed object.
Object name: 'AndroidX.CoordinatorLayout.Widget.CoordinatorLayout'.
I've now noticed that sometimes this also fails on Android (got a crash report) although it mostly works without issue. On iOS it fails pretty much every time.
System.NullReferenceException: Object reference not set to an instance of an object ?, in void TelerikLicense.ShowLicenseMessage(Page page)+() => { } [1] ?, in void RunnableImplementor.Run() ?, in void IRunnableInvoker.n_Run(IntPtr jnienv, IntPtr native__this)
I'm sorry - I don't have a sample repro yet. What I can say is that this seems to fail when running a local build from visual studio 2022. builds that come from the build agent as part of the proper pipeline don't seem to show the licensing popup (which is weird) and as the popup isn't displayed, you can't dismiss it to trigger the crash.
I am testing this on a real iPhone (not a simulator), sometimes that makes a difference for some more exotic issues...
ultimately, I've seen this crash in more than one platform so it seems like a cross platform issue (of differing severity). If I manage to make a reproduction I'll share it here but my time is limited...
Hi Luis,
Thank you for sharing the details of your scenario.
I am currently working on reproducing the issue. I will provide you with an update at the beginning of the next week.
Regards, Nikola Progress Telerik
Enjoyed our products? Share your experience on G2 and receive a $25 Amazon gift card for a limited time!