ThinkGeo.com    |     Documentation    |     Premium Support

License not found on .Net 8.0

Hi,

We have been using MapSuiteMobileForAndroid 10.6.6 in our Xamarin Android Native app.

We migrated the app to .Net 8.0 and it’s now throwing an exception: System.InvalidOperationException: ‘A license is needed to debug/run the APP.’

The license file is still included as AndroidAsset same as before. I also tried to generate a new license file with the Product Center but that didn’t help.

Hi Mikko,

If you meant upgrading to v14 Maui Edition, please following the doc below. Maui’s license is different than the old versions, you need to call License.LoadLicense(“licensefile”) in your code.

License Guide - ThinkGeo Docs

I’m not quite sure what you mean by “migrated the app to .NET 8.” MAUI is the successor to Xamarin.Forms, so if you’re using ThinkGeo’s Xamarin.Forms APIs, MAUI is the appropriate choice. However, if you are directly using MapSuiteMobileForAndroid 10.6.6 which is based on Xamarin.Android, the direct successor would be an .NET 8 Android component, which is currently unavailable. Sorry for any confusion; Microsoft’s naming conventions can be somewhat unclear.

Thanks,
Ben

The App is not usin Xamarin Forms or MAUI, so we are indeed using the non Forms version of MapSuiteMobileForAndroid directly.

However, if you are directly using MapSuiteMobileForAndroid 10.6.6 which is based on Xamarin.Android, the direct successor would be an .NET 8 Android component, which is currently unavailable.

So does this mean that there is currently no MapSuite version that would support .NET 8 Android without MAUI?

Hi Mikko,

I’m afraid that’s right. We do have the .NET8 iOS ( NuGet Gallery | ThinkGeo.UI.iOS 14.3.0-beta034) though as a customer was asking for it, but we don’t have the one for Android. MAUI is generally what we recommended for mobile, but let me know if you want to stick to .net8 Android and I’ll see what we can do.

Thanks,
Ben

Is it possible to use the MAUI version of MapSuite in a non MAUI Android app?

HI Mikko,

It’s not supported out-of-the-box and, even everything is possible, I don’t see an easy way you can do it as MAUI is using a different set of APIs, rely on MAUI’s underlying framework, handlers, and lifecycle which is not the same as Xamarin.Android.

Here is the Maui HowDoI: ThinkGeo / Public / Mobile Maps · GitLab, you can have a quick look and see the difference between Android.

Thanks,
Ben

Hi,

So just to clarify.

At least according to Microsoft it should be possible to embed MAUI controls in to a native .Net Android app: https://learn.microsoft.com/en-us/dotnet/maui/platform-integration/native-embedding?view=net-maui-9.0&pivots=devices-androidhttps://learn.microsoft.com/en-us/dotnet/maui/platform-integration/native-embedding?view=net-maui-9.0&pivots=devices-android

So are you saying that ThinkGeos MAUI control doesn’t support this?

Hi Mikko,

The ThinkGeo MAUI control is a standard .NET MAUI control that doesn’t rely on any third-party packages. Therefore, everything described in the link should also apply to the ThinkGeo MAUI control.

What I meant earlier is that the APIs and lifecycle methods in the MAUI edition aren’t consistent with the old Android edition. As a result, getting it to compile may take some time, and it could potentially lead to future issues. I haven’t tried it yet, but it would be great if it works without requiring too many changes. Please let me know what you find.

Thanks,
Ben