Xamarin Forms iOS realm DirectoryNotFoundException

Viewed 739

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.

1 Answers

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://docs.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://docs.microsoft.com/en-us/visualstudio/install/install-visual-studio-versions-side-by-side?view=vs-2019

Related