question

rasmus-0494 avatar image
2 Votes"
rasmus-0494 asked RobCaplan edited

Xamarin forms iOS: DirectoryNotFoundException

I'm having problems deploying my xamarin forms iOS app . I'm getting this message 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.



dotnet-xamarin
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I also have the same problem. Fresh installs of the latest Visual Studio builds on both Windows and Mac sides. Rebuild All from Windows throws this exception.

1 Vote 1 ·

Same problem here.

0 Votes 0 ·

I also have the same problem. After upgrading to VS 16.10.1.
Anyone found solution?
Please help!

0 Votes 0 ·
JarvanZhang-MSFT avatar image
0 Votes"
JarvanZhang-MSFT answered JarvanZhang-MSFT commented

Hello,​

Welcome to our Microsoft Q&A platform!

It seems to be related to realm, but just a week ago it worked fine.

Hi, rasmus-0494. What is the version of the VS and Xcode you used last week? Someone faced the similar issue on the lastest version of VS and Xcode. There seems to be a potential issue with the lastest release of VS on iOS. The workaround is downgrade the Visual Studio to version16.9.3. For more details, please check the link:
https://stackoverflow.com/questions/67520547/xamarin-forms-ios-realm-directorynotfoundexception

Best Regards,

Jarvan Zhang


If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 7
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi there JarvanZhang. Thanks for taking the time to reply.

I do not use VS on mac, i use it on my PC and use my mac as build host. The issue occured before i upgraded VS on my PC, so i'm not sure this is this issue.. I upgraded to see if an upgrade would fix the issue, but no luck.

0 Votes 0 ·

Oh - and i didn't notice which versions i upgraded, so can't be help with details there..

0 Votes 0 ·

by creating a new blank project, and it worked just fine - until i added realm.

Did this problem also occur for the new created project? If so, there seems to be a potential issue with using realm in xamarin. You could repor the problem to the product team of realm for a solution.

0 Votes 0 ·

I was able to build and deploy my Xamarin Forms iOS app, using VS for Mac instead of Windows..

0 Votes 0 ·

Here is a workaround about the Xcode 12.5 issue for VS you can try, check the details in: https://developercommunity.visualstudio.com/t/VS-2019-1694-cannot-connect-to-iOS-Sim/1412563#T-N1422248

0 Votes 0 ·

Thanks Jarvan, but i'm using a real device and emulator produces same error

0 Votes 0 ·
Show more comments
PabloGasparini-Datamars avatar image
2 Votes"
PabloGasparini-Datamars answered PabloGasparini-Datamars edited

I am having this exact same issue but with SkiaSharp. I just upgraded to VS 16.9.5 to have support for XCode 12.5

there's a thread for this on the developer community forum, be sure to upvote it
https://developercommunity.visualstudio.com/t/Xamarin-Forms-iOS-SkiaSharp-DirectoryNot/1424416

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

rasmus-0494 avatar image
0 Votes"
rasmus-0494 answered

I was able to build and deploy my Xamarin Forms iOS app, using VS for Mac instead of Windows..

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.