Search code examples
nugetmaui.net-mauipendomaui-compat

Integration of the Pendo SDK with the .NET MAUI sample application causes an error


One of our production applications which developed in Xamarin cross platform UI mobile framework, we have been using Pendo-sdk-ios and pendo-sdk-android nuget packages successfully.

https://support.pendo.io/hc/en-us/articles/4404246699419-Developer-s-Guide-to-Installing-the-Pendo-Xamarin-iOS-SDK

Now we are upgrading our xamarin application to .NET MAUI. I am facing an issue, while integrating Pendo-sdk packages with .NET MAUI Appliction.

Here are the steps to reproduce this issue:

A new sample MAUI .NET application has been created, and it has successfully run.

iOS Platform

I added pendo-sdk-ios nuget package version 2.16.0.5665(latest stable version).

I can use the Pendo package in the AppDelegate, the following code does not throw an error.

   using Pendo; 

I am trying to initialize the Pendo SDK in the AppDelegate, however I am getting the following error.

    string pendo_app_key = "eyJhbGci…<KEY_HERE>";
    PendoManager.SharedManager().Setup(pendo_app_key);
    PendoManager.SharedManager().SetDebugMode(true);

.../CheckingPendo/Platforms/iOS/AppDelegate.cs(22,22): Error CS0012: The type 'NSObject' is defined in an assembly that is not referenced. You must add a reference to assembly 'Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'. (CS0012) (CheckingPendo)

I am experiencing the same compile time error after adding Xamarin.ios reference as well.

​​<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-ios'">
      <PackageReference Include="pendo-sdk-iOS" Version="2.16.0.5665" />
    </ItemGroup>
    <ItemGroup>
      <Reference Include="Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065" />
    </ItemGroup>

Android Platform

After adding the pendo-sdk-android nuget package version 2.16.1.4053(latest stable version). I am getting the following error. ​​

/Users/[user]/.nuget/packages/xamarin.android.support.annotations/28.0.0.3/build/monoandroid90/Xamarin.Android.Support.Annotations.targets(3,3): Error MSB4062: The "Xamarin.Android.Support.BuildTasks.VerifyVersionsTask" task could not be loaded from the assembly /Users/[user]/.nuget/packages/xamarin.android.support.annotations/28.0.0.3/build/monoandroid90/Xamarin.Android.Support.BuildTasks.dll. Could not load file or assembly 'Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
 Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. (MSB4062) (CheckingPendo)

I would appreciate your assistance in resolving this issue.


Solution

  • Pendo has released support for maui: Pendo Maui Plugin
    Instruction could be found here