Xamarin Forms iOS realm DirectoryNotFoundException - xcode

I'm having problems deploying my app. I'm getting this after failed deployment:
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.Shared.targets(975,3): warning : [xma]: An error occurred on the receiver while executing a post for topic xvs/build/execute-task/AppName.iOS/be46a7d002fCodesign and client buildbe46a7dea89e48e793bc0f9a0cc351c537bea3be9755ca474d2a7810526c87cc25572Me
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.Shared.targets(975,3): warning : An error occurred on client Build169000292 while executing a reply for topic xvs/build/execute-task/AppName.iOS/be46a7d002fCodesign
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.Shared.targets(975,3): warning : at Xamarin.Messaging.Client.ApplicationMessageExtensions.<>c__DisplayClass10_0`1.<OfResponse>b__1(MqttApplicationMessage m) in C:\A\1\230\s\src\Xamarin.Messaging.Client\Extensions\ApplicationMessageExtensions.cs:line 194
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.Shared.targets(975,3): warning : at System.Reactive.Linq.ObservableImpl.Select`2.Selector._.OnNext(TSource value) in d:\a\1\s\Rx.NET\Source\src\System.Reactive\Linq\Observable\Select.cs:line 39
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.Shared.targets(975,3): warning : --- End of stack trace from previous location where exception was thrown ---
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.Shared.targets(975,3): warning : at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.Shared.targets(975,3): warning : at Xamarin.Messaging.Client.MessagingClient.<PostAsync>d__21`2.MoveNext() in C:\A\1\230\s\src\Xamarin.Messaging.Client\MessagingClient.cs:line 190
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.Shared.targets(975,3): error : MessagingRemoteException: An error occurred on client Build169000292 while executing a reply for topic xvs/build/execute-task/AppName.iOS/be46a7d002fCodesign
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.Shared.targets(975,3): error : AggregateException: One or more errors occurred.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.Shared.targets(975,3): error : DirectoryNotFoundException: Could not find a part of the path '/Users/username/Library/Caches/Xamarin/mtbs/builds/AppName.iOS/be46a7dea89e48e793bc0f9a0cc351c537bea3be9755ca474d2a7810526c87cc/bin/iPhone/Debug/device-builds/iphone11.8-14.4.1/AppName.iOS.app/Frameworks/realm-wrappers.framework/_CodeSignature'.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.Shared.targets(975,3): error :
It seems to be related to realm, but just a week ago it worked fine.
I've tried various supposed solutions i've found when googling - cleaning buildfolders, deleting bin and obj folders, cleaning the cache on buildhost found at path ~/Library/Caches/Xamarin/mtbs.
I have a valid developer certificate, and provisioning profile - so that should not be the issue..
Finaly i verified i could actually connect to the buildhost by creating a new blank project, and it worked just fine - UNTIL i added realm.
I'm all up to date with latest version of xcode and visual studio. I've spend a lot of time trying to fix this, so i'm hoping someone can help with a solution.

Not sure if you are using the latest Visual Studio 2019 16.9.5 But i had similar issue (except around SkiaSharp) when I upgraded to this version which also triggered an Update of iOS SDK on my mac.
I reinstalled Visual Studio 16.9.3 as second install, which then rolled back the iOS SDK on Mac and now can build same project fine again.
Unsure if its VS or the iOS SDK or both?
You can download old release here:
https://learn.microsoft.com/en-us/visualstudio/releases/2019/history#installing-an-earlier-release
and then need to run installer in command line if you want to ride side by side:
https://learn.microsoft.com/en-us/visualstudio/install/install-visual-studio-versions-side-by-side?view=vs-2019

Related

Visual Studio UWP: Where is the path to External Dependencies defined?

I have a UWP C++ project with links to external Dependencies, that have #includes to files that don't exist.
eg
This is actually the Cordova SQLite windows plugin, so not a project I created myself.
When I build, I get many errors...
Severity Code Description Project File Line Suppression State
Error (active) E1696 cannot open source file "wrl\client.h" SQLite3.UWP C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\agile.h 16
Error (active) E1696 cannot open source file "winapifamily.h" SQLite3.UWP C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt\corecrt.h 196
Error (active) E0020 identifier "IUnknown" is undefined SQLite3.UWP C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\agile.h 26
Error (active) E0020 identifier "HRESULT" is undefined SQLite3.UWP C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\agile.h 27
Error (active) E0145 variable "Platform::Details::GetProxyImpl" may not be initialized SQLite3.UWP C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\agile.h 27
Error (active) E0282 the global scope has no "IUnknown" SQLite3.UWP C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\agile.h 27
Error (active) E0029 expected an expression SQLite3.UWP C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\agile.h 27
Error (active) E0020 identifier "HRESULT" is undefined SQLite3.UWP C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\agile.h 28
Error (active) E0145 variable "Platform::Details::ReleaseInContextImpl" may not be initialized SQLite3.UWP C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\agile.h 28
Error (active) E0282 the global scope has no "IUnknown" SQLite3.UWP C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\agile.h 28
Error (active) E0029 expected an expression SQLite3.UWP C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\agile.h 28
Error (active) E0020 identifier "HRESULT" is undefined SQLite3.UWP C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\agile.h 31
Error (active) E0282 the global scope has no "IUnknown" SQLite3.UWP C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\agile.h 31
Error (active) E0020 identifier "HRESULT" is undefined SQLite3.UWP C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\agile.h 37
Error (active) E0282 the global scope has no "IUnknown" SQLite3.UWP C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\agile.h 37
Error (active) E0059 function call is not allowed in a constant expression SQLite3.UWP C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt\corecrt.h 197
Error C1083 Cannot open include file: 'winapifamily.h': No such file or directory SQLite3.UWP c:\program files (x86)\windows kits\10\include\10.0.15063.0\ucrt\corecrt.h 196
When I browse to where one of the files that does exist reside, explorer open up at C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt. This files has (for example) the following #include <winapifamily.h>, and this file does not exist in that folder.
However, if I search for this file in the root of the Window Kit folder, I do find it in other folders..
Going into the project properties, I see the following...
Finally drilling in more, I see...
So, the version it appears to be referencing is 10.0.15063.0, and this folder does NOT have some of the headers being referenced.
My question is, today (Sept 2019), on Windows 10, how do I defined this (and other ) include paths?
I have read many posts, but depending on the post date, you get different answers and none have helped in my case.
Update 1
Going into the project settings, I noticed that the Platform Toolset was set to v140.
I swapped this to v141 as below...
I now get less errors...
And the source folder for one of the files referencing the missing winapifamily.h is now C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt
Opening it, I can see that the winapifamily.h is still not there.
Where would there be a a collection of headers in such a toolkit that references missing files... I just can't understand this.
Update 2
I have removed and readded the plugin, and went from 3.2.0 to ^3.3.0"
The file referencing the winapifamily.h (corecrt.h) is located in C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt, and there is no winapifamily.h in this folder.
Platform toolkit in the UWP project is set to Visual Studio 2017 (v141)
I realised I did not have Windows 10 SDK (10.0.15063.0) installed. I went into Visual Studio installer and went into modify for Visual Studio 2017
After installing these (for desktop, UWP and C++), my project would finally build.

Build Failed after adding Kapsel Plugins to Cordova Project - Could not find SDK "Microsoft.VCLibs, Version=12.0"

I'm trying to make a Windows Cordova build using cmd but I'm getting below errors. Can any of you please guide me on how to fix this issue.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(
2377,5): error MSB3774: Could not find SDK "Microsoft.VCLibs, Version=12.0".
No valid MSBuild was detected for the selected target: Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild.exe: Command failed with exit code 1
PS: I'm using Visual Studio Community 2017.

Xamarin Studio Build Error File 'Windows.Props' not found

I just downloaded Xamarin studio but when I try to compile the code it gets this error:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\
Microsoft.AppXPackage.Targets(9,9):
Error APPX1639: File 'Windows.props' not found.
See http://go.microsoft.com/fwlink/?prd=12395&pver=1.0&plcid=0x409&ar=MSDN&sar=PlatformMultiTargeting&o1=
C:\Program Files (x86)\Microsoft SDKs\Portable\v12.0&o2=Portable for more information. (APPX1639) (ToDo)
I already installed the sdk for Windows 10, and tried to repair the app but nothing happened.

Visual Studio 2013 Community weird errors

I have recently installed Visual Studio Community 2013 with update 4 and when I try to build my project I get these errors(see below):
C:\Program Files(x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets(362,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry. TargetFrameworkVersion or PlatformToolset may be set to an invalid version number.
1> main.cpp
1>c:\program files (x86)\microsoft sdks\windows\v7.1a\include\sal_supp.h(57): warning C4005: '__useHeader' : macro redefinition
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\sal.h(2886) : see previous definition of '__useHeader'
1>c:\program files (x86)\microsoft sdks\windows\v7.1a\include\specstrings_supp.h(77): warning C4005: '__on_failure' : macro redefinition
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\sal.h(2896) : see previous definition of '__on_failure'
How to solve them? I tried many ways but no luck.
Go to control panel and go to uninstall program.
Choose your visual studio community edition update 4. Select change or repair, if it's there. If it opens to the Visual Studio window then select repair there.
Select repair.
Keep your internet connection on while you do this, so your sdk and platform tools can be updated.
If this doesn't work, there are some links to altering the registry:
https://stackoverflow.com/a/24478856/3956566
https://social.msdn.microsoft.com/Forums/vstudio/en-US/48a4500c-2c48-43dd-822b-10e83258d18b/warning-msb8003-could-not-find-windowssdkdir-variable-from-the-registry-targetframeworkversion-or?forum=visualstudiogeneral
How to set SGEN toolpath in Msbuild to target 3.5 framework
https://code.google.com/p/gyp/issues/detail?id=457

type_traits errors

When in VS2010 I add
#include <iostream>
to console aplication template I get many errors in type_traits
error C2275: '_Ty' : illegal use of this type as an expression c:\program files (x86)\microsoft visual studio 11.0\vc\include\type_traits 762 1 pcl1 (Visual Studio 2010)
error C3861: '__is_standard_layout': identifier not found c:\program files (x86)\microsoft visual studio 11.0\vc\include\type_traits 762 1 pcl1 (Visual Studio 2010)
error C2955: 'std::_Cat_base' : use of class template requires template argument list c:\program files (x86)\microsoft visual studio 11.0\vc\include\type_traits 763 1 pcl1 (Visual Studio 2010)
error C2275: '_Ty' : illegal use of this type as an expression c:\program files (x86)\microsoft visual studio 11.0\vc\include\type_traits 768 1 pcl1 (Visual Studio 2010)
an many others...
I don't know why why but I think it's somehow connected with the fact that I'm using both VS2012 and VS2010. How to fix it?
From the error message it is clear that your VS2010 project is somehow being directed to look in the VS2012 include directory, c:\program files (x86)\microsoft visual studio 11.0\vc\include. This is never a good idea.
Check your project settings under C/C++ / General / Additional Include Directories. Remove any references to compiler include directories. The correct directories for your compiler will be automatically located by the system.

Resources