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] `Microsoft.Intune.Maui.Essentials.Android` Support for Visual Studio for Mac #174

Closed gustavoja closed 1 year ago

gustavoja commented 1 year ago

Build fails after adding the Microsoft.Intune.Maui.Essentials.Android nuget package on a newly created MAUI application and also a .NET7 Android application

To Reproduce Steps to reproduce the behavior:

  1. Using visual studio for mac 17.5.7 (build 6)
  2. Create a new .NET MAUI App or an Android Application
  3. Add Microsoft.Intune.Maui.Essentials.Android nuget package
  4. Try to build the project
  5. The build fails with the following message

/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 '.nuget/packages/microsoft.intune.maui.essentials.android/9.5.2-beta2/build/netstandard2.0/BuildTool\bin\BuildToolCLI.bat' with working directory '/Projects/testandroid'. 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() (testandroid)

Expected behavior: The project and the app can be built and launch on Visual Studio for mac and Visual Studio for Windows

Intune App SDK Xamarin Bindings (please complete the following information):

Additional context:

ihariza commented 1 year ago

Any news?

gustavoja commented 1 year ago

Hello! Any thoughts on this?

bannus commented 1 year ago

This is a known issue and will be resolved in a future release.

Internal tracking #24314899
MikeP0911 commented 1 year ago

Hello @gustavoja @bannus

Im facing the same issue in Visual Studio for Windows. Create a new maui project and when the Microsoft.Intune.Maui.Essentials.Android package is installed there is immediately build error. Below is the ticket. https://github.com/msintuneappsdk/ms-intune-app-sdk-android/issues/176

@gustavoja In which version of Visual Studio for windows you were able to able to test successfully. It would be of great help if you could tell us.

Thanks

MikeP0911 commented 1 year ago

@gustavoja You had mentioned that this works in windows. Did you succeed by creating a MAUI project and including the library? It would be of great help if you could get back.

gustavoja commented 1 year ago

Hello @MikeP0911 sorry for the delay. I currently have this working on a PC here you have the Visual Studio version details

Microsoft Visual Studio Community 2022 Version 17.6.2 VisualStudio.17.Release/17.6.2+33723.286 Microsoft .NET Framework Version 4.8.09037

Installed Version: Community

ADL Tools Service Provider 1.0 This package contains services used by Data Lake tools

ASA Service Provider 1.0

ASP.NET and Web Tools 17.6.326.62524 ASP.NET and Web Tools

Azure App Service Tools v3.0.0 17.6.326.62524 Azure App Service Tools v3.0.0

Azure Data Lake Tools for Visual Studio 2.6.5000.0 Microsoft Azure Data Lake Tools for Visual Studio

Azure Functions and Web Jobs Tools 17.6.326.62524 Azure Functions and Web Jobs Tools

Azure Stream Analytics Tools for Visual Studio 2.6.5000.0 Microsoft Azure Stream Analytics Tools for Visual Studio

C# Tools 4.6.0-3.23259.8+c3cc1d0ceeab1a65da0217e403851a1e8a30086a C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Extensibility Message Bus 1.4.21 (main@8f226a8) Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

Microsoft Azure Hive Query Language Service 2.6.5000.0 Language service for Hive query

Microsoft Azure Stream Analytics Language Service 2.6.5000.0 Language service for Azure Stream Analytics

Microsoft Azure Tools for Visual Studio 2.9 Support for Azure Cloud Services projects

Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Mono Debugging for Visual Studio 17.6.41 (790a401) Support for debugging Mono processes with Visual Studio.

NuGet Package Manager 6.6.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

Razor (ASP.NET Core) 17.6.0.2326105+37f2727000f6a964584cafb86e69cf0b39baecb7 Provides languages services for ASP.NET Core Razor.

SQL Server Data Tools 17.6.13.0 Microsoft SQL Server Data Tools

ToolWindowHostedEditor 1.0 Hosting json editor into a tool window

TypeScript Tools 17.0.20329.2001 TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 4.6.0-3.23259.8+c3cc1d0ceeab1a65da0217e403851a1e8a30086a Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 17.6.0-beta.23174.5+0207bea1afae48d9351ac26fb51afc8260de0a97 Microsoft Visual F# Tools

Visual Studio IntelliCode 2.2 AI-assisted development for Visual Studio.

VisualStudio.DeviceLog 1.0 Information about my package

VisualStudio.Mac 1.0 Mac Extension for Visual Studio

VSPackage Extension 1.0 VSPackage Visual Studio Extension Detailed Info

Xamarin 17.6.0.251 (d17-6@318364c) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 17.6.6.0 (remotes/origin/d17-6@cb430751d1) Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates 17.6.32 (98c12a2) Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK 13.2.0.6 (d17-5/a200af1) Xamarin.Android Reference Assemblies and MSBuild support. Mono: 6dd9def Java.Interop: xamarin/java.interop/d17-5@149d70fe SQLite: xamarin/sqlite/3.40.1@68c69d8 Xamarin.Android Tools: xamarin/xamarin-android-tools/d17-5@9f02d77

Xamarin.iOS and Xamarin.Mac SDK 16.4.0.6 (97731c92c) Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

MikeP0911 commented 1 year ago

@gustavoja Thank you for your reply! We found the issue. The issue is because of the space in the folder name which was causing the bug. Once the space was removed it worked like charm.

gustavoja commented 1 year ago

Excellent @MikeP0911 I'm glad to be of help

MikeP0911 commented 1 year ago

@gustavoja

Are you using com.microsoft.intune.mam.client.support.v4.content.MAMFileProvider in your project. we receive an error while using this in MAUI Intune Android SDK. This was not throwing any errors in Xamarin Android intune package. https://github.com/msintuneappsdk/ms-intune-app-sdk-android/issues/184

gustavoja commented 1 year ago

Hey @MikeP0911, no I'm not using it still.

On this moment I'm just testing the integration with our app because I have a lot of random freeze after the library was added. Are you having some similar issue?

MikeP0911 commented 1 year ago

Hey @gustavoja ! Of course we too experience freezes. The build time has also increased as far as we have noticed. Not sure why it is. We suspect the missing of com.microsoft.intune.mam.client.support.v4.content.MAMFileProvider as a bug since that was available in Xamarin Intune SDK for Android. We are stuck here and couldn't move forward in migration.

gustavoja commented 1 year ago

@MikeP0911 that's sad maybe @bannus can help you with that.

OuR build time seems stable but the package size increased like 40%.

I identified that the random freeze might be happening when we load several stuff at the same time on the UI thread although it is working correctly when the library is not added. A workaround was to slow down every image load so they're not loaded concurrently but we still having some issues on other pages that I couldn't identify. The whole app seems NOW more sensitive to ANR

Archit-Pikle commented 1 year ago

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