microsoftconnect / ms-intune-app-sdk-android

Intune App SDK for Android enables data protection features and mobile app management via Microsoft Intune
41 stars 17 forks source link

[.NET MAUI] Build error while installing MAM Intune SDK in MAUI solution #185

Closed NiladriPadhy closed 8 months ago

NiladriPadhy commented 9 months ago

Intune Android App SDK for .NET MAUI Issue

Summary

After adding the nuget package to the MAUI project. The project is not building.

Details

Logs

For build issues, please include: Users/niladri/.nuget/packages/microsoft.intune.maui.essentials.android/9.5.2-beta2/build/netstandard2.0/Microsoft.Intune.Maui.Essentials.android.targets(13,13): Error MSB4184: The expression "[MSBuild]::VersionLessThanOrEquals('', 33.0.26)" cannot be evaluated. Version string was not in a correct format. (MSB4184) (com.microsoft.rightsmanagement.mobile.viewer.android)

MSBuild Logs

Company Portal Logs

NuGet Dependencies

If your app includes third-party NuGet libraries, please list them here:

Questions to Ask Before Submission

  1. Does the app build and launch without including the Microsoft.Intune.Maui.Essentials.android package? Yes
  2. Does the issue reproduce if you rebuild after deleting the bin and obj output folders? - Yes
  3. Have you checked the .NET MAUI repository for similar issues? If so, please follow the guidance there or add that information to this issue. - Yes
  4. Are you using the latest Microsoft.Intune.Maui.Essentials.android NuGet package version? - Yes
Archit-Pikle commented 9 months ago

Hi @NiladriPadhy, is the build only failing on Mac? Our current release doesn't support building on Mac and we will be adding support in a future release. Please refer #174 for more information

NiladriPadhy commented 9 months ago

Hi @NiladriPadhy, is the build only failing on Mac? Our current release doesn't support building on Mac and we will be adding support in a future release. Please refer #174 for more information

@Archit-Pikle Currently we have MAC system only. Will check in Windows. Thanks a lot for your response.

NiladriPadhy commented 9 months ago

@Archit-Pikle Created a new MAUI Project and installed only MAM Intune getting same issue. WhatsApp Image 2023-09-29 at 5 14 23 PM WhatsApp Image 2023-09-29 at 5 13 41 PM

Archit-Pikle commented 9 months ago

Hi @NiladriPadhy , this looks very similar to https://github.com/msintuneappsdk/ms-intune-app-sdk-android/issues/176

Could you try adding Microsoft.Intune.Maui.Essentials.android package only for Android builds using the following code as a workaround?

<ItemGroup Condition=" '$(TargetPlatformIdentifier)' == 'Android' "> <PackageReference Include="Microsoft.Intune.Maui.Essentials.android" Version="9.5.2-beta2"/> </ItemGroup>

Archit-Pikle commented 8 months ago

Building on a Mac is supported in version 9.7.1-beta which should now be available

NiladriPadhy commented 8 months ago

Getting below error /Users/niladri/.nuget/packages/microsoft.intune.maui.essentials.android/9.5.2-beta2/build/netstandard2.0/Microsoft.Intune.Maui.Essentials.android.targets(9,9): Error: An error occurred trying to start process '/Users/niladri/.nuget/packages/microsoft.intune.maui.essentials.android/9.5.2-beta2/build/netstandard2.0/BuildTool\bin\BuildToolCLI.bat' with working directory '/Users/niladri/Microsoft/WS/AIPViewer/AIPViewer'. No such file or directory at System.Diagnostics.Process.ForkAndExecProcess(ProcessStartInfo startInfo, String resolvedFilename, String[] argv, String[] envp, String cwd, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec) at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) at Core.BuildToolCLI.ExecuteBuildToolCLIProcess(Argument input, Argument output, Argument classpath, Argument excludeClasses, Argument reportPath, String workingDirectory, CancellationToken cancellationToken) at Core.Mamifier.Mamify() at BuildTasks.MamifyFiles.Execute() (AIPViewer)

Archit-Pikle commented 8 months ago

This should be fixed in version 9.7.1-beta. Please update Microsoft.Intune.Maui.Essentials.Android