Xamarin Forms for iOS 'Could not AOT the assembly' - xamarin

i am develop an app using xamarin forms, when i deploy for android it works fine but for iOS it gives an error
Could not AOT the assembly '/Users/MyUser/Library/Caches/Xamarin/mtbs/builds/DemoApp.iOS/1200d99a740029217aed9915fa08d90d/C:/Users/MANISH~1.TIW/AppData/Local/Temp/vs370F.tmp/iPhone/Debug/device-builds/iphone6.1-12.0/mtouch-cache/3-Build/DemoApp.iOS.exe' DemoApp.iOS
So can anyone please help me out from this issue ?
Build Log:
2>E:\BudhiPrakash Data\android-sdk-new\tools\XamarinProjects\MyApps\ExampleApp\ExampleApp.iOS\Controls\CustomElementFrameRenderer.cs(35,35,35,75): warning CS0618: 'Frame.OutlineColorProperty' is obsolete: 'OutlineColorProperty is obsolete as of version 3.0.0. Please use BorderColorProperty instead.'
2>E:\BudhiPrakash Data\android-sdk-new\tools\XamarinProjects\MyApps\ExampleApp\ExampleApp.iOS\Service\IosDownloader.cs(34,30,34,32): warning CS0168: The variable 'ex' is declared but never used
2>E:\BudhiPrakash Data\android-sdk-new\tools\XamarinProjects\MyApps\ExampleApp\ExampleApp.iOS\Controls\CustomElementFrameRenderer.cs(67,33,67,64): warning CS0618: 'Frame.OutlineColor' is obsolete: 'OutlineColor is obsolete as of version 3.0.0. Please use BorderColor instead.'
2> ExampleApp.iOS -> E:\BudhiPrakash Data\android-sdk-new\tools\XamarinProjects\MyApps\ExampleApp\ExampleApp.iOS\bin\iPhone\Debug\ExampleApp.iOS.exe
2> Detected signing identity:
2> Code Signing Key: "iPhone Developer: AVC SDF (234)" (3434)
2> Provisioning Profile: "iOS Team Provisioning Profile: *" (23423-423423-4234-234-234)
2> Bundle Id: com.app
2> App Id: SDFSDFSD.com.app
2> /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch #/Users/rajeev/Library/Caches/Xamarin/mtbs/builds/ExampleApp.iOS/1200d99a740029217aed9915fa08d90d/C:/Users/MANISH~1.TIW/AppData/Local/Temp/vs370F.tmp/iPhone/Debug/device-builds/iphone6.1-12.0/response-file.rsp -v -v -v -v
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(842,3): warning : The runtime version supported by this application is unavailable.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(842,3): error MT3001: Could not AOT the assembly '/Users/rajeev/Library/Caches/Xamarin/mtbs/builds/ExampleApp.iOS/1200d99a740029217aed9915fa08d90d/C:/Users/MANISH~1.TIW/AppData/Local/Temp/vs370F.tmp/iPhone/Debug/device-builds/iphone6.1-12.0/mtouch-cache/3-Build/ExampleApp.iOS.exe'
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========
Diagnose Log:
CopyingFile - Path: /Users/rajeev/Library/Caches/Xamarin/mtbs/builds/HelpBuddiePrism.iOS/1200d99a740029217aed9915fa08d90d/bin/iPhone/Debug/device-builds/iphone6.1-12.0/HelpBuddiePrism.iOS.app/Close.png
CopyingFile - PercentComplete: 99%
CreatingStagingDirectory - PercentComplete: 5%
ExtractingPackage - PercentComplete: 15%
InspectingPackage - PercentComplete: 20%
TakingInstallLock - PercentComplete: 20%
PreflightingApplication - PercentComplete: 30%
VerifyingApplication - PercentComplete: 40%
APIInternalError: Failed to unhide archs in executable file:///private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.MG8Wit/extracted/HelpBuddiePrism.iOS.app/HelpBuddiePrism.iOS

Related

Microsoft Visual Studio Community 2022 (64-bit) 17.4.2 can't debug .Net Standard 2.0 Xamarin on Samsung Galaxy J5 2016 with Android 7.1.1

I made that question to the Microsoft community months ago, the solution I came up with was to install the previous version of Visual Studio, 17.2.6, that could work with that phone. Then I got a new testing phone and I could debug on it just fine with any later Visual Studio version. But that old problem resurfaced when I tried to debug on my old phone again lately.
So, when I try to debug on the Samsung J5 I get the message that deployment is successful but debugging and the app stop. The app gets installed on the phone just fine, I can run it and test things, and for those parts that I would have added breakpoints I add temporary log entries to see what is happening. But debugging would be so much faster and easier. So I don't know what happened to Visual Studio 2022 after version 17.2.6 and the debugging on the J5 stopped working without changing the Android project's settings.
On to the output. The last lines of the Build output:
Found device: dbb6c608
Creating "obj\Debug\130\upload.flag" because "AlwaysCreate" was specified.
Creating directory "obj\.cache\".
Done building project "iService5.Droid.csproj".
Build succeeded.
2>Deployment was successful to Samsung SM-J510FN.
========== Build: 1 succeeded, 0 failed, 3 up-to-date, 0 skipped ==========
========== Elapsed 02:07,822 ==========
========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========
========== Elapsed 02:07,824 ==========
Last lines of Build Order output:
2>Starting deployment to Samsung SM-J510FN ...
2>Deploying to Samsung SM-J510FN ...
2>Deployment was successful to Samsung SM-J510FN.
========== Build: 1 succeeded, 0 failed, 3 up-to-date, 0 skipped ==========
========== Elapsed 02:07,822 ==========
========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========
========== Elapsed 02:07,824 ==========
On Debug output:
This debug engine does not support exception conditions. The condition(s) will be ignored.
Forwarding debugger port 8815
Detecting existing process
> am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.bshg.iservice5.droid/crc649586142a72936f38.MainActivity"
> Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.bshg.iservice5.droid/crc649586142a72936f38.MainActivity launchParam=MultiScreenLaunchParams { mDisplayId=0 mBaseDisplayId=0 mFlags=0 } }
The error I get in Xamarin Diagnostics window:
[E:]: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
at System.String.Format(String format, Object[] args)
at Mono.AndroidTools.AndroidLogger.LogError(String task, String format, Object[] args) in D:\a\_work\1\s\External\androidtools\Mono.AndroidTools\AndroidLogger.cs:line 63
at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass118_0.<RunShellCommandAsync>b__0() in D:\a\_work\1\s\External\androidtools\Mono.AndroidTools\AndroidDevice.cs:line 1012
[D:RunShellCommand]: dbb6c608 setprop "debug.mono.extra" ""
-- Start SetProperty - 12/02/2022 13:15:16 (148.7124ms) --
[INPUT] setprop "debug.mono.extra" ""
[OUTPUT]
-- End SetProperty --
[D:RunShellCommand]: dbb6c608 am force-stop com.bshg.iservice5.droid
-- Start ForceStop - 12/02/2022 13:15:16 (1794.4007ms) --
[INPUT] am force-stop com.bshg.iservice5.droid
[OUTPUT]
-- End ForceStop --
I have searched and searched and I can't find anything usefull. As for the configuration:
Android Options
Advanced Android Options
Deleting bin and obj after testing different Android options made no difference. The same options debug on the new phone just fine. And I haven't changed the developers setting in the J5. They are the same ones that VS 17.2.6 could debug with.
I am currently installing 17.2.6 to exist in parallel with 17.4.2 on my pc to see if that will help. But any insights regarding the reason behind my problem would be greately appreciated!
Edit: Community is not available for versions before 17.2.10 anymore. So I'll try 17.2.10.
Edit 2: 17.2.10 debugs on my old phone just fine. Same settings, same everything. So, since our target android version is now 13 on the solution on latest vs, I also created a clone of the repo to work with on the old phone because older vs can have only up to android 12.1 as a target version.

How do I install the Visual Studio Tools for Xamarin preview?

I am trying to follow the instructions on this webpage: https://devblogs.microsoft.com/visualstudio/hyper-v-android-emulator-support/
I have reached step 2 and downloaded the zip file. However, there is no executable. How do I install this preview? Is the preview the same as this: https://visualstudio.microsoft.com/xamarin/ ?
Update
Following Rajesh Sonars answer, here is the error I get running inside Visual Studio 2019:
1>------ Build started: Project: App1, Configuration: Debug Any CPU ------
1>App1 -> C:\Users\bert\Desktop\Xamarin2019\App1\App1\App1\bin\Debug\netstandard2.0\App1.dll
2>------ Build started: Project: App1.Android, Configuration: Debug Any CPU ------
2> App1.Android -> C:\Users\bert\Desktop\Xamarin2019\App1\App1\App1.Android\bin\Debug\App1.Android.dll
2> No way to resolve conflict between "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e". Choosing "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily.
3>Starting deployment to my_device ...
3>Starting emulator my_device ...
3>C:\Program Files (x86)\Android\android-sdk\emulator\emulator.EXE -no-boot-anim -avd my_device -prop monodroid.avdname=my_device
3>Warning: Quick Boot / Snapshots not supported on this machine. A CPU with EPT + UG features is currently needed. We will address this in a future release.emulator: ERROR: x86 emulation currently requires hardware acceleration!
3>
3>Please ensure Windows Hypervisor Platform (WHPX) is properly installed and usable.
3>CPU acceleration status: HAXM is not installed on this machine
3>Emulator my_device cannot be started.
========== Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
Update 2
My processor is: Intel (R) Core i7 950 # 3.07 GHz. I have the following BIOS: P6X58D-E version 0502
I initially enabled the two settings in the BIOS:
advanced/cpu configuration/Intel(R) Virtualisation Tesc
advanced/chipset/intel vt-d configuration/intel vt-d
Is there anything else I need to enable. I accessed my BIOS this morning to retrieve these settings (so I could update my question) and it appears the second one is disabled. I definitely enabled it (I even took a photo at the time and checked the photo today). I am going to try and enable it later. I want to research what it is first though because I tend to experience BSOD when I change BIOS settings.
On Windows:
To try out Xamarin Preview features, you need to install Visual Studio Preview version which can be install side by side of your stable/release Visual Studio.
On Mac: You can select preview update channel
Observation :
If I try to launch emulator by running the app, I get following error and deployment get cancelled.
But, If I launch emulator explicitly from Tools > Android > Android Device Manager > Start, then it launches and I can deploy and test on it.

VS 2017 for Android emulator not working - xamarin

Installed VS 2017 (prof & community) RTM for xamarin development. Getting the below error while running the app. I have verified that installed the Intel Acceleration component. Any insights ?
1>C:\Users\Sowmyan\documents\visual studio 2017\Projects\App1\App1\App1.Android\App1.Android.csproj : warning XA0105: The $(TargetFrameworkVersion) for FormsViewGroup.dll (v7.1) is greater than the $(TargetFrameworkVersion) for your project (v6.0). You need to increase the $(TargetFrameworkVersion) for your project.
1>C:\Users\Sowmyan\documents\visual studio 2017\Projects\App1\App1\App1.Android\App1.Android.csproj : warning XA0105: The $(TargetFrameworkVersion) for Xamarin.Forms.Platform.Android.dll (v7.1) is greater than the $(TargetFrameworkVersion) for your project (v6.0). You need to increase the $(TargetFrameworkVersion) for your project.
1>C:\Users\Sowmyan\documents\visual studio 2017\Projects\App1\App1\App1.Android\App1.Android.csproj : warning XA0105: The $(TargetFrameworkVersion) for Xamarin.Forms.Platform.dll (v7.1) is greater than the $(TargetFrameworkVersion) for your project (v6.0). You need to increase the $(TargetFrameworkVersion) for your project.
1> Processing: obj\Debug\res\layout\tabbar.xml
1> Processing: obj\Debug\res\layout\toolbar.xml
1> Processing: obj\Debug\res\values\styles.xml
1> Processing: obj\Debug\res\layout\tabbar.xml
1> Processing: obj\Debug\res\layout\toolbar.xml
1> Processing: obj\Debug\res\values\styles.xml
2>Starting deploy VisualStudio_android-23_x86_phone ...
2>Starting emulator VisualStudio_android-23_x86_phone ...
2>C:\PROGRA~2\Android\ANDROI~1\tools\emulator.EXE -partition-size 512 -no-boot-anim -avd VisualStudio_android-23_x86_phone -prop monodroid.avdname=VisualStudio_android-23_x86_phone
**2>emulator: ERROR: x86 emulation currently requires hardware acceleration!**
2>Please ensure Intel HAXM is properly installed and usable.
2>CPU acceleration status: HAXM is not installed on this machine
2>Emulator VisualStudio_android-23_x86_phone cannot be started.
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
I had a similar problem on my laptop. It turned out the Virtualization was turned off in my BIOS. My recommendation is to enter the BIOS setup on reboot (refer to manual as all machines are different) and see if Intel Virtualization is enabled. If not, you will need to enable it.

Visual Studio deploy fails with "The method or operation is not implemented"

I'm trying to remotely debug a Windows 8.1 app on an x86 tablet.
The Remote Debugger is started on the Tablet, but every time I try to deploy the app to the Tablet, the Visual Studio output window shows this:
1>------ Build started: Project: $REDACTED, Configuration: Debug x86 ------
1> $REDACTED-> C:\Users\$REDACTED\bin\x86\Debug\$REDACTED.exe
2>------ Deploy started: Project: $REDACTED, Configuration: Debug x86 ------
2>Error: The method or operation is not implemented.
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
Also, the Remote Debugger on the tablet prints Failed attempt to connect from $REDACTED
Changing remote machine (VS 2015 Remote Debugger settings) from No Authentication to Windows Authentication fixed the problem for me.

Deployment error in local pc using visual studio

I am getting problem while deploying fake driver in my local windows virtual Computer.
I am getting error like,
Deploying driver files for project "C:\ioctl\sys\sioctl-Package\sioctl-Package.vcxproj". Deployment may take a few minutes...
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\x64\ImportAfter\DriverDeployment8.0.targets(69,9): error : Kernel mode drivers cannot be deployed to the local machine
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\x64\ImportAfter\DriverDeployment8.0.targets(69,9): error : Value cannot be null.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\x64\ImportAfter\DriverDeployment8.0.targets(69,9): error : Parameter name: path
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========

Resources