Resolving Xamarin AOT Errors - xamarin.ios

I am getting the following when deploying from Windows to an iOS device:
Could not AOT the assembly
'/Users/buildserver/Library/Caches/Xamarin/mtbs/builds/Investor.iOS/d99017eb03395769b8f7f4a145086854/obj/iPhone/Debug/mtouch-cache/64/3-Build/TPService.dll' Investor.iOS C:\Program
Files (x86)\Microsoft Visual
Studio\2017\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets
My question is two-fold:
What causes this issue and how do I resolve it?
My project settings are as follows:

Related

Installed Custom Visualizer not loading in VS2022

I am trying for some hours to install a custom visualizer in VS2022. Basically it is a simple string visualizer that opens a wpf form.
I followed this: https://learn.microsoft.com/en-us/visualstudio/debugger/how-to-install-a-visualizer?view=vs-2022
But the instructions do not seem to work.
When the visualizer and the test console app are in the same solution, the visualizer works, shows up. Everything is alright, but that is not of too much help
What I have tried until now, but without success:
Copy all visualizer dlls in C:\Users\XXXX\Documents\Visual Studio 2022\Visualizers
Copy all visualizer dlls in C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\Packages\Debugger\Visualizers
Checked on multiple projects, some targeting .NET Framework 4.7.2, some .NET 6
Checked on one of my colleagues pc, also with VS2022
Copied all dlls to a folder here(where I found DataSetVisualizer and IEnumerableVisualizer): C:\Program Files\Microsoft Visual
Studio\2022\Professional\Common7\IDE\CommonExtensions\Platform\Debugger\
Run devenv /ResetSettings from an admin console
Run devenv /resetskippkgs from an admin console
Run Visual Studio as administrator
Checked in Debug => Windows => Modules to see if the custom dll is loaded
Do you guys have any idea what should I try? Or what could be the problem?
Did any of you succeeded in running a custom visualizer in VS2022
Thank you
So, after some days, and many hours of trial and error, I could finally install and see my custom visualizer.
Basically, what I have done and (I think) it solved the issues:
Cleaned up all the dlls from "C:\Users\XXXX\Documents\Visual Studio 2022\Visualizers" and all of its subfolders corresponding to .net framework versions
Checked that my visualizer corresponds to the correct type:
[assembly: DebuggerVisualizer(
typeof(DebuggerSide),
typeof(TextChunkObjectSource),
Target = typeof(IEnumerable),
Description = "PDF Visualizer")]
Don't put List<TextChunk>, or IReadOnlyList<TextChunk>, instead of IEnumerable<TextChunk>
Delete bin folder(s) and rebuild the visualizer project
Make sure to copy the dlls in all the needed folders:
I had to copy them here:
C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\Packages\Debugger\Visualizers\
C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\Packages\Debugger\Visualizers\netstandard2.0\
C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\Packages\Debugger\Visualizers\netcoreapp\

Build of Xamarin iOS app fails on VS for Windows when using dynamic version of BlackBerry Dynamics SDK

We are currently switching from the static version of BlackBerry Dynamics SDK for Xamarin iOS to the new dynamic version. As far as I understand now GoodDynamics.iOS.dll does not contain all the resources anymore, but instead references the contents of the folder "GoodDynamics.iOS.resources" which has to be in the same folder as the dll.
The problem is that the native linking fails when trying to build Xamarin iOS apps using that new library on Visual Studio for Windows (paired to a Mac build agent).
Here's what I did:
Downloaded the BlackBerry Dynamics SDK for Xamarin iOS version 10.1.0.663
Extracted the "Examples" solution from there and loaded it into Visual Studio
Adjusted the bundle id in the "info.plist" in one of the projects to fit our provisioning profile, so it can be signed
Build the project
Result: Using Visual Studio on Mac OS it builds fine. But when I try to build it from Windows with Visual Studio paired to a Mac build agent I get the following messages/error in the build output:
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(235,3): warning MT1302: Could not extract the native library 'libGD_CPPWrapper.a' from '/Users/{UserName}/Library/Caches/Xamarin/mtbs/builds/GreetingsClient/dafdd80e9da4129fe5916d9283ff66211b655dba54eca9615ebdc599e5fa50eb/obj/iPhone/Debug/mtouch-cache/libGD_CPPWrapper.a'. Please ensure the native library was properly embedded in the managed assembly (if the assembly was built using a binding project, the native library must be included in the project, and its Build Action must be 'ObjcBindingNativeLibrary').
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(235,3): error : no such file or directory: '/Users/{UserName}/Library/Caches/Xamarin/mtbs/builds/GreetingsClient/dafdd80e9da4129fe5916d9283ff66211b655dba54eca9615ebdc599e5fa50eb/obj/iPhone/Debug/mtouch-cache/libGD_CPPWrapper.a'
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(235,3): error : clang: error: no such file or directory: '/Users/{UserName}/Library/Caches/Xamarin/mtbs/builds/GreetingsClient/dafdd80e9da4129fe5916d9283ff66211b655dba54eca9615ebdc599e5fa50eb/obj/iPhone/Debug/mtouch-cache/libGD_CPPWrapper.a'
Note: I exchanged the real user name by {UserName} in the above log lines.
So it seems it cannot find the contents of that GoodDynamics.iOS.resources folder where the 'libGD_CPPWrapper.a' and the xcframework folders are located. These don't even seem to get copied to the build Mac. Any ideas how I should adjust the build process so it can be built from Windows too?

Error message by trying to compile code using "x86_amd64\cl.exe" to generate 64bit application

I got this error message by trying to compile small piece of code using "C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\x86_amd64\cl.exe" to generate 64bit application
"The application or DLL c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\amd64\mspdb80.dll is not a valid Windows image. Please check this aganist your installation diskette"

Failure during conversion to COFF: file invalid or corrupt

When I try building just a simple program into VS2010, compiling succeeds yet when I try to build the solution it gives me this error:
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
What am I doing wrong?
I had this issue and I solved it with this thread
disable incremental linking, by going to
Project Properties
-> Configuration Properties
-> Linker (General)
-> Enable Incremental Linking -> "No (/INCREMENTAL:NO)"
This issue occurred after Visual Studio 2012 installation.
The issue resolved by replacing the cvtres.exe from VS2010 with the one from VS2012.
Thank you to "social.msdn"!
I had this issue after installing dotnetframework4.5.
Open path below:
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin" ( in 64 bits machine)
or
"C:\Program Files\Microsoft Visual Studio 10.0\VC\bin" (in 32 bits machine)
In this path find file cvtres.exe and rename it to cvtres1.exe then compile your project again.
Had to install VS 2010 SP1 in order to get it to work again for myself. Lame microsoft.
Do you have Visual Studio 2012 installed as well? If so, 2012 stomps your 2010 IDE, possibly because of compatibility issues with .NET 4.5 and .NET 4.0.
See http://social.msdn.microsoft.com/Forums/da-DK/vssetup/thread/d10adba0-e082-494a-bb16-2bfc039faa80
I am using Visual Studio 2010.
This happened to me when I installed .NET 4.5.
Uninstall of .NET 4.5 and install of .NET 4.0 helped me and error messages disappeared.
If you have installed VS2012 as well, the old cvtres file will no longer work.
Try removing the file (I simply renamed):
C:\Program Files
(x86)\Microsoft Visual Studio 10.0\VC\BIN\cvtres.exe
You can also debug using the /VERBOSE linker option in order to get more information regarding the linker error. There you should see an error message that the invoke to cvtres fails.
In my case it was just caused because there was not enough space on the disk for cvtres.exe to write the files it had to.
The error was preceded by this line
CVTRES : fatal error CVT1106: cannot write to file

winsock2.h, no such file or directory

I have this error while compiling my Visual C++ project in Visual Studio 2008 on XP. How to resolve this error :(
Error 1 fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlbase.h 68 WOT
Your Windows SDK is not configure correctly. The easiest way to fix this is to install Windows 7 SDK. (yes, you can install it on windows xp and develop for xp)
simply go to project->project properties
linker->input
in additional dependencies add ws2_32.lib
linker ->command line add here ws2_32.lib
click start

Resources