iOS application getting crashed "Could not set up parent class, due to: Invalid generic instantiation" .net MAUI - maui

.net MAUI Project based on .net version 7 getting crashed while I am trying to deploy it on device. Below is the exception I am getting:
Visual Studio for Mac version :17.4(build 2406)
.net version: .net 7
iPhone 13, iOS 16.3
below are the packages being used:
Crashlogs:
Unhandled Exception: System.TypeLoadException: Could not set up parent class, due to: Invalid generic instantiation assembly:/private/var/containers/Bundle/Application/8849B149-36C8-4750-86DD-2AAC2A958F3D//Microsoft.Maui.dll type:ViewHandler2 member:(null) at CommunityToolkit.Maui.AppBuilderExtensions.<>c.b__0_0(IMauiHandlersCollection h) in /_/src/CommunityToolkit.Maui/AppBuilderExtensions.shared.cs:line 28 at Microsoft.Maui.Hosting.HandlerMauiAppBuilderExtensions.HandlerRegistration.AddRegistration(IMauiHandlersCollection builder) at Microsoft.Maui.Hosting.Internal.MauiHandlersFactory.CreateHandlerCollection(IEnumerable1 registrationActions) at Microsoft.Maui.Hosting.Internal.MauiHandlersFactory..ctor(IEnumerable`1 registrationActions) at Microsoft.Maui.Hosting.HandlerMauiAppBuilderExtensions.<>c.b__1_0(IServiceProvider sp) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.<…>

Related

Cant build ios project, no such module or this SDK is not supported by compiler

So I got an demo ios project from different company but I can't launch it
Basically i get two errors:
Sometimes I also go an unsupported swift architecure error
I work on M2 processor and use XCode 14.2
Project does not have pods, all packages are managed via spm (that's what I was told)
For now i tried:
opening xcode via rosetta (nothing changed)
changing version of xcode to 14.0 (nothing changed)
using other swift version via toolchain (Swift 5.7), screen below ( get different erorrs but i dont think its a good way)
UPDATE
I downloaded version 14.0 of xcode and toolchain 5.7.2
When i use that version of xcode i get an error about missing classes from that sdk in scope and also some weird error from SentrySamplingProvider ( screens below)

.NET 6 Integration tests in Visual Test give error - The specified version of Microsoft.NetCore.App or Microsoft.AspNetCore.App was not found

I have migrated an integration test project from .Net Framework 4.8 to .NET6. The tests are running fine in local development machine. But when the same code is run using visual studio test task in Azure Devops release pipeline it is giving me the following error
HTTP Error 500.31 - ANCM Failed to Find Native Dependencies.
The specified version of Microsoft.NetCore.App or Microsoft.AspNetCore.App was not found.
Based on some of the suggestions for similar issue, I installed .Net 6 core runtime using use .net core task, and also gave console options as below to force the runtime version, but the error doesn't go away. The project is configured to run on Any CPU.
console options: /Platform:x64 /Framework:.NetCoreApp,Version=v6.0 /logger:trx;LogFileName=netcore-results.trx

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

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?

Flutter not building iOS application, is it a swift error?

I'm not longer able to build an iOS app with XCode, even a brand new flutter application will not run.
Here's the version of Android Studio:
Android Studio 3.1.4
Build #AI-173.4907809, built on July 23, 2018
JRE: 1.8.0_152-release-1024-b01 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.13.6
Here's the version of XCode:
Version 9.4.1 (9F2000)
I get the following error:
Launching lib/main.dart on Andrea's iPad in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: XG2RLBENW5
Starting Xcode build...
Xcode build done.
Failed to build iOS app
Error output from Xcode build:
↳
2018-09-15 15:56:05.469 xcodebuild[39750:2818902] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-14098/Xcode3Core/LegacyProjects/Frameworks/DevToolsCore/DevToolsCore/BuildSystem/Runtime/PBXTargetBuildContext.mm:757
Details: unexpected successful exit code from cancelled command
Object:
Method: -createCommandInvocationRecordFromInvocation:
Thread: {number = 9, name = (null)}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
** BUILD FAILED **
Xcode's output:
↳
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
The use of Swift 3 #objc inference in Swift 4 mode is deprecated. Please address deprecated #objc inference warnings, test your code with “Use of deprecated Swift 3 #objc inference” logging enabled, and then disable inference by changing the "Swift 3 #objc Inference" build setting to "Default" for the "Runner" target.
The use of Swift 3 #objc inference in Swift 4 mode is deprecated. Please address deprecated #objc inference warnings, test your code with “Use of deprecated Swift 3 #objc inference” logging enabled, and then disable inference by changing the "Swift 3 #objc Inference" build setting to "Default" for the "Runner" target.
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
/Users/pbirdsall/Documents/highline/LeverageGoogleServersPlist/GoogleService-Info.plist:0: error: reading data: The file “GoogleService-Info.plist” couldn’t be opened because there is no such file.
Could not build the precompiled application for the device.
Error launching application on Andrea's iPad.
The error is saying:
"An App ID with Identifier 'com.test.flutterApp' is not available.
Please enter a different string"
You need a different bundle id for your project as com.test.flutterApp may be registered under different Apple ID. Change it to anything unique and try to run it
EDIT
The new error says: GoogleService-Info.plist couldn't be found at
/Users/pbirdsall/Documents/highline/LeverageGoogleServersPlist/GoogleService-Info.plist
Make sure you have the plist file.

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.