PrepareResourceRules task failed error while building .NET MAUI app in VS for Mac - maui

I'm able to build my .NET MAUI app on my Windows 11 machine using VS 2022 17.4.4 but when I try to build it on a Mac using VS 2022 17.4.3 (Build 21), it fails with the following error:
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/16.1.1481/tools/msbuild/iOS/Xamarin.Shared.targets(3,3):
Error MSB4018: The "PrepareResourceRules" task failed unexpectedly.
System.IO.DirectoryNotFoundException: Could not find a part of the
path
'/Users/user231632/Documents/MyAppFolder/MyApp/bin/Release/net7.0-ios/ios-arm64/MyApp.app/ResourceRules.plist'.
Any idea what the problem is?

Related

"'dotnet.exe' exited with code -2147450750 " error in visual studio 2022 for MAUI

got "'dotnet.exe' exited with code -2147450750 " error while running android emulator choose "Release" instead of Debug in visual studio 2022 for MAUI.
How to fix it...
I installed .net latest version

.Net7 MAUI app unable to debug/publish with iOS16/Xcode 14

I can debug on MyMac (Mac Catalyst) no problem but not on the simulator, I get the following errors in the Application Output:
xcodebuild[4480:64944] Writing error result bundle to /var/folders/wh/z7x5swm90fb6f6cxfp39760h0000gn/T/ResultBundle_2022-30-10_10-46-0020.xcresult
xcodebuild: error: SDK "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" cannot be located.
xcrun: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -find simctl 2> /dev/null' failed with exit code 16384: (null) (errno=Invalid argument)
xcrun: error: unable to find utility "simctl", not a developer tool or in PATH
I'm using VS17.4 (preview 5 I think, how do I check? It just says 17.4 build 2339) and Xcode 14 for the iOS 16 SDK. I've checked in Preferences > SDK Locations > Apple and everything looks as it should... I'm a Mac noob so is there just a setting I'm missing somewhere?
If I try to build the release for publish like so VisualStudio crashes!
dotnet publish -f:net7.0-ios -c:Release
Update:
I just dropped back to net6.0 and am getting the same error. I didn't have Xamarin.Mac installed but installing it made no difference.
Below are some more component details of VS:
Xamarin.iOS Version: 16.0.0.72 (Visual Studio Community)
Xcode 14.0.1 (21336)
Xamarin.Mac Version: 8.12.0.2 (Visual Studio Community)
I can also see that the directory referenced does exist, or is it not supposed to look like that?
I had two version of Xcode installed which seems to have confused things. Uninstalling both then reinstalling 14 has fixed the issue.

Error while launching flutter Application

I am new to flutter development so i followed the google getting started with flutter page as is.
When i used the andriod studio (or) visual studio to create a demo flutter application and try to run it on a emulator i get the below lines .
*Launching lib\main.dart on sdk gphone x86 arm in debug mode...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
What went wrong:
Could not open settings generic class cache for settings file 'D:\personalnicknacks\softwares\flutter\hello_app_world\android\settings.gradle' (C:\Users\ing12703.gradle\caches\6.7\scripts\1fnwrr8g4rohfp291nvlxj5qe).
BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 60
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 1s
Exception: Gradle task assembleDebug failed with exit code 1*
I have the tried following things.
1)Ensured my JAVA_HOME environment is correct pointing.
2)used the latest java version 16.0
3)used the andriod studio to install the flutter plugins.
4)have also tried to install the gradel manually using the page https://gradle.org/install/#manually
5)now even my gradel output is correct
C:\Users\ing12703>gradle -v
Welcome to Gradle 7.0.2!
Here are the highlights of this release:
File system watching enabled by default
Support for running with and building Java 16 projects
Native support for Apple Silicon processors
Dependency catalog feature preview
For more details see https://docs.gradle.org/7.0.2/release-notes.html
Gradle 7.0.2
Build time: 2021-05-14 12:02:31 UTC
Revision: 1ef1b260d39daacbf9357f9d8594a8a743e2152e
Kotlin: 1.4.31
Groovy: 3.0.7
Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM: 16.0.1 (Oracle Corporation 16.0.1+9-24)
OS: Windows 10 10.0 amd64
The suggestion I got online was to downgrade the JDK to say a 12 or so but is that the only viable option or am i missing something?
OK another thing i did try now was to indeed delete JAVA SDK 16 and install the JAVA SDK 15 and it works like a charm.
However I still wonder how do we know when to upgrade to latest JAVA SDK? is some compatibility list of SDK and their respective versions available in flutter documentation?

2.170.1\Modules\DTAExecutionHost.exe' failed with exit code 1

I am trying to run my automation pipeline on Private hosted agent and getting error as Test Run Failed.
Error: The process 'C:\agent_work_tasks\VSTest_ef087383-ee5e-42c7-9a53-ab56c98420f9\2.170.1\Modules\DTAExecutionHost.exe' failed with exit code 1
Vstest failed with error. Check logs for failures. There might be failed tests.
Error: The process 'C:\agent_work_tasks\VSTest_ef087383-ee5e-42c7-9a53-ab56c98420f9\2.170.1\Modules\DTAExecutionHost.exe' failed with exit code 1 Vstest failed with error. Check logs for failures. There might be failed tests.
Based on the error message, the reason for this issue should be that the VSTest task supported .Net Framework 4.6.2 from version 2.170.1.
You need to check the .NET framework version installed on the build agent machine. If the .NET framework version installed on the machine is 4.6.1 or less than that then can you please try upgrading the .Net framework version to 4.6.2.
Here is a doc about the requirement about the Visual Studio test task:
If you're using a Windows self-hosted agent, be sure that your machine
has this prerequisite installed:
.NET Framework 4.6.2 or a later version
In addition, you can try to use the Visual Studio test task version 1.

Xamarin.iOS: Deploying to device fails with "failed to acquire command execution log"

My iOS app built in Visual Studio with a Xamarin Mac build host runs on the iOS simulator but does not deploy to the device. The Mac server log shows this:
[2013-07-30 13:28:45.7] Handling with command: [Build: CommmandUrl=Build] (20)
[2013-07-30 13:28:45.7] Attempting to acquire command execution lock, timeout set to 00:10:00
[2013-07-30 13:30:56.4] Error: Failed to acquire command execution log, the request timed out
[2013-07-30 13:30:56.4] Command [Build: CommmandUrl=Build] finished (17)
Incidentally, is that a typo in line 3 - shouldn't it read "lock" not "log"?
We are using Xamarin Studio 4.0.10 (build 7), Xamarin.iOS 6.4.0.2 (Business Edition), XCode 4.6.2 (2067.2) Build 4H1003.
What is the cause of this error, and how can we get past it?
After talking with Xamarin folks I was told that a fix was included in the Beta for Xamarin.iOS 6.4.1. I switched my Xamarin Studio to the Beta Channel (via the update dialog) and am now able to deploy as before.