pendo-io / pendo-mobile-sdk

Pendo captures product usage data, gathers user feedback, and lets you communicate in-app to onboard, educate, and guide users to value
https://www.pendo.io
Other
58 stars 2 forks source link

Pendo MAUI Nuget - Causes Android Build Errors #179

Closed wynston-champion-actabl closed 1 month ago

wynston-champion-actabl commented 1 month ago

Whenever the latest version of pendo-maui version - 3.3.2.8694 is installed, I am not able to build locally to Android.

I get the following errors:

image

image

I noticed that the following were also installed when the pendo-maui nuget was installed. Shouldn't AndroidX be used instead of Android when using MAUI? It seems like these packages are what is causing the build issue.

image

noambartouv commented 1 month ago

Hi @wynston-champion-actabl,

Our SDK contains these dependencies, allowing the prompt of an an in-app Android Play Store Review, available via our Pendo guides feature. There are no AndroidX equivalents for these libraries so I don't see this as an issue—see nugget store.

Are you perhaps importing Play Core or Play Review for usage in your application as well? This could explain why it's being generated more than once and then we could fix it by excluding one of the gradle imports.

If not, you mention the issue exists on our latest version. Did you manage to successfully use previous versions of our SDK?

DavidPendo commented 1 month ago

Hi @wynston-champion-actabl! Regarding your issue, can you please send us the list of your project dependency packages by running the dotnet list package --include-transitive?

The pendo-maui nuget package contains only the

Xamarin.Google.Android.Play.Core.Common                    2.0.3.2        
Xamarin.Google.Android.Play.Review                                2.0.1.3        
Xamarin.Google.Android.Play.Review.Ktx                          2.0.1.2       

So, if your project uses some other dependency, maybe PlayCore besides Pendo, it might cause the issue... of more than one managed type...

To exclude certain package from the project dependencies you can try to use

<PackageReference Include="<<package-name>>" Version="<<version>>">
      <ExcludeAssets>All</ExcludeAssets>
</PackageReference>

! Remember that if you exclude the Pendo Play packages, the Pendo in-app-rating feature will not work.

l0gaw commented 1 month ago

Is there a workaround for that?

DavidPendo commented 1 month ago

Hi @l0gaw, the workaround is to exclude one of the conflicting packages, as was mentioned in the previous comment. In case the excluded package is of Pendo please note that it will affect the in-app-rating feature to not work.

To exclude Pendo use the following:

<PackageReference Include="Xamarin.Google.Android.Play.Core.Common" Version="2.0.3.2" ExcludeAssets="All"/> 

<PackageReference Include="Xamarin.Google.Android.Play.Review" Version="2.0.1.3" ExcludeAssets="All"/>

<PackageReference Include="Xamarin.Google.Android.Play.Review.Ktx" Version="2.0.1.2" ExcludeAssets="All"/>
l0gaw commented 1 month ago

Thanks. This workaround worked!

wynston-champion-actabl commented 3 weeks ago

@DavidPendo I am still having the same errors with the solution your provided above.

These are the packages I am using in my project:

<PackageReference Include="Xamarin.AndroidX.Collection" Version="1.4.0.5" Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'" />

<PackageReference Include="Xamarin.AndroidX.Collection.Ktx" Version="1.4.0.4" Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'" />

<PackageReference Include="Xamarin.AndroidX.Activity" Version="1.9.0.3" Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'" />

<PackageReference Include="Xamarin.AndroidX.Activity.Ktx" Version="1.9.0.3" Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'" />

<PackageReference Include="Xamarin.AndroidX.Browser" Version="1.8.0.3" Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'" />`