microsoftconnect / ms-intune-app-sdk-android

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

[.NET MAUI] The MAM transofrmation failed unexpectedly #182

Closed MikeP0911 closed 1 year ago

MikeP0911 commented 1 year ago

Intune Android App SDK for .NET MAUI Issue

Summary

Converted the Xamarin App to a MAUI app. Also included the Microsoft.Intune.Maui.Essentials.android package instead of the Intune Android Xamarin bindings. When building the project, it throws an error stating "Microsoft.Intune.Maui.Essentials.android".

Details

the error is thrown in the file named Microsoft.Intune.Maui.Essentials.android. targets on the line number 287

 <MamifyFiles Files="@(_IntuneExtractedJarImports);@(_IntuneAndroidJavaLibrary)"
              Classpath="$(_IntuneClasspath)"
              BuildToolArgsDirectory="$(_IntuneMamifyRemappingPath)"
              BuildToolReportPath="$(_IntuneMamifyRemappingPath)report" />

Logs

2>C:\NugetPackages\microsoft.intune.maui.essentials.android\9.5.2-beta2\build\netstandard2.0\Microsoft.Intune.Maui.Essentials.android.targets(287,9): error : The MAM transofrmation failed unexpectedly, please review the verbose logs for more details. 2>Done building project "ZipExtractMaui.csproj" -- FAILED.

Questions to Ask Before Submission

  1. Does the app build and launch without including the Microsoft.Intune.Maui.Essentials.android package?
  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 1 year ago

Hi @MikeP0911, can you upload verbose binlogs from the failed build?

MikeP0911 commented 1 year ago

@Archit-Pikle Please find the Verbose Log file (detailed log) below: VerboseLog-detailed.txt

Also please find the build log: Output-Build.txt

Thanks in advance

Archit-Pikle commented 1 year ago

@MikeP0911 , in the verbose logs I see that the MamifyFiles task is sending C:\TFS_Final\License as an argument to the invocation call and is unable to find it. Can you verify that the files exists at the correct path?

Arguments: --input C:\TFS_Final\License Kanri\ZipExtractMaui\ZipExtractMaui\obj\Debug\net7.0-android33.0\intune\build-tool\remap\input.txt --output C:\TFS_Final\License Kanri\ZipExtractMaui\ZipExtractMaui\obj\Debug\net7.0-android33.0\intune\build-tool\remap\output.txt --excludeClasses mono.MonoRuntimeProvider;androidx.startup.InitializationProvider --classpath "C:\Program Files (x86)\Android\android-sdk\platforms\android-33\android.jar;C:\Users\testuser\.nuget\packages\microsoft.intune.maui.essentials.android\9.5.2-beta2\build\netstandard2.0\Resources\classes.jar" --report C:\TFS_Final\License Kanri\ZipExtractMaui\ZipExtractMaui\obj\Debug\net7.0-android33.0\intune\build-tool\remap\report --xamarin
2>        File: C:\TFS_Final\License not found.
MikeP0911 commented 1 year ago

@Archit-Pikle Thank you for the response. The cause of the bug is a space in the folder name. If there is any space in the file path, the SDK fails at MAMification. It was not an issue in Xamarin Android SDK.

Now everything builds successfully.