Share via

Xamarin forms iOS: DirectoryNotFoundException

rasmus 11 Reputation points
2021-05-13T15:19:22.867+00:00

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.

Developer technologies | .NET | Xamarin

3 answers

Sort by: Most helpful
  1. Pablo Gasparini 11 Reputation points
    2021-05-17T21:10:47.237+00:00

    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

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments

  2. rasmus 11 Reputation points
    2021-05-21T09:31:07.823+00:00

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

    Was this answer helpful?

    0 comments No comments

  3. JarvanZhang 23,971 Reputation points
    2021-05-14T09:47:45.833+00:00

    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.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.