Failed to read file attributes for "/Users/Resources/Media.xcassets" No such file or directory

Mr_PearceMr_Pearce USMember ✭✭

Hi i updated Xamarin Visual Studio to 4.2 yesterday (and also Xamarin Studio on Mac and XCode to 8 on mac)

Since that, i cannot run my Xamarin.Forms IOS app from Visual Studio Xamarin (Same Project on Xamarin Studio on Mac works fine).

I Get The Error Failed to read file attributes for "/Users/Resources/Media.xcassets"

And the asset-manifest.plst found inside my actool folder says "No such file or directory"

I am using an Asset Catalog for my App Icons only. So That is not much problem in not using them.
But it sucks that it worked fine just before the update...

«1

Answers

  • BlakeRossBlakeRoss USMember
    edited September 2016

    I've got the same problem. Updated to the latest Stable build and now I can't build our Xamarin Forms iOS project in Visual Studio. Similar error:

    Failed to read file attributes for "/Users/[user folder]/Library/Caches/Resources/Images.xcassets"

    Edit: Also updated Xcode to 8 on the mac

  • LeonardHarrisLeonardHarris USMember
    edited September 2016

    Try deleting your obj folder in your shared and ios projects then go to your iOS project > resources and remove any .xcassets folders that might be causing issues, lastly delete any items in your assets catalogs in your solution explorer that might also be causing issues, then build again. You may need to re-add any Asset Catalog later.

  • BlakeRossBlakeRoss USMember

    I removed the Images.xcassets folder and the matching asset catalog from the project and I was able to build. However, after adding a new one back in, the build breaks again. Same error message:

    Failed to read file attributes for "/Users/[user folder]/Library/Caches/Resources/Images.xcassets"

  • Mr_PearceMr_Pearce USMember ✭✭

    @LeonardHarris said:
    Try deleting your obj folder in your shared and ios projects then go to your iOS project > resources and remove any .xcassets folders that might be causing issues, lastly delete any items in your assets catalogs in your solution explorer that might also be causing issues, then build again. You may need to re-add any Asset Catalog later.

    Not Worked for me.

    When i delete the Asset Catalogs from the Sulution it works.
    As soon as i add them again(appicons only) it stops building.

  • I'm encountering the same problem since last update.

  • DRGDRG USMember

    Me too. However it works fine in Xamarin Studio running on the Mac.

  • Solution:
    https://forums.xamarin.com/discussion/58770/could-not-load-asset-catalogs
    "I found the fix was to delete the ~/Library/Caches/Xamarin/mtbs/builds directory on the build server."

    This is worked for me

  • Ryan_SouthRyan_South USMember
    edited September 2016

    I am having the same issue too. I deleted the mtbs folder and it work once then it is failing again with the same error as OP.

  • Mr_PearceMr_Pearce USMember ✭✭

    @AlexanderEpstine said:
    Solution:
    https://forums.xamarin.com/discussion/58770/could-not-load-asset-catalogs
    "I found the fix was to delete the ~/Library/Caches/Xamarin/mtbs/builds directory on the build server."

    This is worked for me

    This works once and only for the device/simulator you selected first.
    IF you change the device i get the good old error....

    So not really a solution but a not even nice workaround.

  • Yes, it seems you right. This works for simulator. But not once - I launched application many times.

  • Mr_PearceMr_Pearce USMember ✭✭

    @AlexanderEpstine said:
    Yes, it seems you right. This works for simulator. But not once - I launched application many times.

    sry just testet it again.
    for me running it on simulators works multiple times BUT when i change to or from my physical ipad air i get the error
    (i have only one physical device to test, running on it works also mutliple times as long as i dont change to a simular)

  • Yes. I have same problem

  • Failed to read file attributes for "/Users/admin/Assets.xcassets" Sled.iOS C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets 1028

    Seems like this issue is everywhere.
    Some fix / workarounds yet ?

  • FabioHenriqueFabioHenrique USMember ✭✭

    Yep, same problem here

  • Sledgehammer777Sledgehammer777 USUniversity ✭✭

    Something added an Images catalog to my Asset Catalogs folder in the Solution Explorer. I don't use it or need it in my project. I deleted the catalog and everything works fine now.

  • WonjaeChoiWonjaeChoi USMember ✭✭

    Same problem here. Guessing that the problem comes from /Users/ prefix in the path...

  • JayPetersonJayPeterson USMember ✭✭

    I'm using a mac with parallels (visual studio 2015, plus mac agent)... BUT going onto my mac and clearing out the entire folder /users/[username]/Library/Caches/Xamarin WORKED!!

  • I had the same problem, what fixed it for me was to create (in my case it was missing) the /users/[username]/Library/Caches/Xamarin/Resources folder on my build machine and copy the *.xcassets from my PC containing the project to this new folder on my build machine (Mac).

  • Sadly, I also have this problem, but deleting the folder isn't a solution for me, because there is another bug; when building Xamarin.iOS, sometimes it does not finds some .nib files (which isn't necessary but the IDE thinks it is), and the workaround for this is to remove the Debug folders from /bin and /obj. So if I delete the 'build' folder, this problem goes away, but another comes. If i handle that problem, this comes again.

    p.s.
    I'm starting to have trust issues with Xamarin - any tech advice or help I've asked in e-mail from a tech spec stood unanswered until this day.

  • KeeKeeKeeKee USMember ✭✭

    Have anyone reported this bugs? Horrible.

  • What @SimonBelanger mentioned worked for me as well, so copying the Resources (containing the Images.xcassets) folder to the user's directory and copying the Assets.xcassets to the Users directory made it work again. But this bug is really annoying, sysadmins will lose their hairs when we need to modify the Users directory on a mac (of course it needs administrator privileges). I think this one's easy to fix in a patch, only the path where the app searches for these files is wrong. We decided not to lose more time on editing the Xamarin.iOS.common.targets, hope someone will fix it soon.

  • JohnMillerJohnMiller USForum Administrator, Xamarin Team Xamurai

    Hey All,

    This sounds similar to the bug report here. However, our team is having a hard time reproducing the issue. Is anyone able to upload a project/sample that reproduces the issue to that bug report? If yes, please include version information and the steps needed to reproduce it.

  • fehro84fehro84 USMember ✭✭

    @AlexanderEpstine said:
    Solution:
    https://forums.xamarin.com/discussion/58770/could-not-load-asset-catalogs
    "I found the fix was to delete the ~/Library/Caches/Xamarin/mtbs/builds directory on the build server."

    This is worked for me

    Worked for me too. Thanks.

  • EvgeniyZverevEvgeniyZverev USMember ✭✭
    edited October 2016

    The same problem here.

    Besides, I cannot find the mentioned

    ~/Library/Caches/Xamarin/mtbs/builds
    or
    /users/[username]/Library/Caches/Xamarin/Resources

    directories on my Mac build machine.

    How do I workaround the problem?

  • EvgeniyZverevEvgeniyZverev USMember ✭✭
    edited October 2016

    Google helped me to find out that the mentioned directories are hidden and cannot be accessed directly.
    For those who are not familiar with the Mac world like me: you can get into a hidden directory via "Finder->Go->Go to Folder..." tool (use app menu on the screen top). In the input type something like "/users/zverev.eugene/Library" and then you can see the darn hidden folder.

  • emafemaf USXamarin Team Xamurai

    Hi all,
    We're still not able to reproduce this issue, is anyone able to provide the logs via Help > Xamarin > Zip Logs... while connected to the Mac (that brings the Mac logs) and a Detailed Build Output so we can investigate it?

    To change the Build Output verbosity go to Tools > Options > Project and Solutions > Build and Run and change "MSBuild project build output verbosity" to Detailed. Then build and get the detailed output from the Output window.

    Thanks!

  • SylvainGravelSylvainGravel CAMember ✭✭

    See attached files

  • SylvainGravelSylvainGravel CAMember ✭✭

    After removing the mtbs folder, I get a 1 time successful build. See attached file.

  • EvgeniyZverevEvgeniyZverev USMember ✭✭

    For me the problem reproduces when I have the iOS project images as ".xcassets" and the project is checked into my TFS version control store. Besides the TFS connection is managed by Visual Studio. Mind that Xamarin.iOS for Visual Studio does not know how to handle xcassets and the image files are not a part of the Visual Studio project and they are checked-in into TFS manually.

    So when I check-out my iOS project via Visual Studio the xcassets files remain checked-in into the TFS and thus they remain read-only.

    If I manually remove the read-only flag from xcassets files then the problem does not to reproduce.

    I am not quite sure that this is it i.e. I do not have enough time in order to execute proper experiments. Just an observation.

  • LeighBowersLeighBowers GBMember

    @CarelLotz said:
    Ran into the same issue this morning after upgrading to the latest Xamarin toolchain. Clearing the cache folder did not work for me. I did some further investigation by comparing the .csproj files of a project that compiles with one that doesn't compile. I found the following ItemGroup that is not being used in the one project.

    <ItemGroup> <ImageAsset Include="Resources\NativeApi.xcassets\AppIcons.appiconset\Contents.json"> <InProject>false</InProject> </ImageAsset> <ImageAsset Include="Resources\NativeApi.xcassets\LaunchImages.launchimage\Contents.json"> <InProject>false</InProject> </ImageAsset> </ItemGroup>

    If I delete this from the project file and then recompile, everything suddenly works as it should. I'm not sure how this got into the project in the first place, but looking through the Git history it has been in the project for a while. The other interesting thing about the issue is that the project that fails to compile is actually referencing the project that contains the ItemGroup. In my scenario I have InTouch.Mobile.iOS.UI.csproj that references InTouch.Mobile.iOS.csproj. The ItemGroup is contained in the InTouch.Mobile.iOS.csproj and not in the iOS.UI.csproj. This is confusing as it is the iOS.UI.csproj that fails to compile and not .iOS.csproj.

    Perhaps just a further suggestion as to the origin of the problem. I've had lots of problems in the previous version with working with Image Assets using Xamarin Studio and then opening that same project later on in Visual Studio 2015 to do some refactorings etc. using R#. The last time I looked VS 2015 was not able to handle Asset Libraries elegantly so you are forced to use XStudio for doing this. However, it seems like the changes been made by XStudio in the csproj is not always successfully ignored by VS 2015. I suspect this area to maybe be the source of these kinds of problems.

    Hope this gives some further clues as to what is going wrong.

    Hurrah! This fixed the issue for me. Many thanks!

  • EvgeniyZverevEvgeniyZverev USMember ✭✭

    @CarelLotz said:
    Ran into the same issue this morning after upgrading to the latest Xamarin toolchain. Clearing the cache folder did not work for me. I did some further investigation by comparing the .csproj files of a project that compiles with one that doesn't compile. I found the following ItemGroup that is not being used in the one project.

    <ItemGroup> <ImageAsset Include="Resources\NativeApi.xcassets\AppIcons.appiconset\Contents.json"> <InProject>false</InProject> </ImageAsset> <ImageAsset Include="Resources\NativeApi.xcassets\LaunchImages.launchimage\Contents.json"> <InProject>false</InProject> </ImageAsset> </ItemGroup>

    If I delete this from the project file and then recompile, everything suddenly works as it should. I'm not sure how this got into the project in the first place, but looking through the Git history it has been in the project for a while. The other interesting thing about the issue is that the project that fails to compile is actually referencing the project that contains the ItemGroup. In my scenario I have InTouch.Mobile.iOS.UI.csproj that references InTouch.Mobile.iOS.csproj. The ItemGroup is contained in the InTouch.Mobile.iOS.csproj and not in the iOS.UI.csproj. This is confusing as it is the iOS.UI.csproj that fails to compile and not .iOS.csproj.

    Perhaps just a further suggestion as to the origin of the problem. I've had lots of problems in the previous version with working with Image Assets using Xamarin Studio and then opening that same project later on in Visual Studio 2015 to do some refactorings etc. using R#. The last time I looked VS 2015 was not able to handle Asset Libraries elegantly so you are forced to use XStudio for doing this. However, it seems like the changes been made by XStudio in the csproj is not always successfully ignored by VS 2015. I suspect this area to maybe be the source of these kinds of problems.

    Hope this gives some further clues as to what is going wrong.

    I checked my iOS projects and found out that I had the mentioned

    <ImageAsset Include="Resources\NativeApi.xcassets\AppIcons.appiconset\Contents.json">
      <InProject>false</InProject>
    </ImageAsset>
    <ImageAsset Include="Resources\NativeApi.xcassets\LaunchImages.launchimage\Contents.json">
      <InProject>false</InProject>
    </ImageAsset>
    

    items in my project files long before the problem showed up.

  • DavidStrickland0DavidStrickland0 USMember ✭✭✭
    edited October 2016

    Basically by deleting those from your project file your doing the same thing as just selecting the catalog in your project and removing it.

    Oh and for whats its worth Me to.

  • SylvainGravelSylvainGravel CAMember ✭✭

    Any progress?

  • @SimonBelanger said:
    I had the same problem, what fixed it for me was to create (in my case it was missing) the /users/[username]/Library/Caches/Xamarin/Resources folder on my build machine and copy the *.xcassets from my PC containing the project to this new folder on my build machine (Mac).

    yeah it worked! Thanks!

  • GaryGormleyGaryGormley AUMember ✭✭

    @CarelLotz said:
    Ran into the same issue this morning after upgrading to the latest Xamarin toolchain. Clearing the cache folder did not work for me. I did some further investigation by comparing the .csproj files of a project that compiles with one that doesn't compile. I found the following ItemGroup that is not being used in the one project.

    <ItemGroup> <ImageAsset Include="Resources\NativeApi.xcassets\AppIcons.appiconset\Contents.json"> <InProject>false</InProject> </ImageAsset> <ImageAsset Include="Resources\NativeApi.xcassets\LaunchImages.launchimage\Contents.json"> <InProject>false</InProject> </ImageAsset> </ItemGroup>

    If I delete this from the project file and then recompile, everything suddenly works as it should. I'm not sure how this got into the project in the first place, but looking through the Git history it has been in the project for a while. The other interesting thing about the issue is that the project that fails to compile is actually referencing the project that contains the ItemGroup. In my scenario I have InTouch.Mobile.iOS.UI.csproj that references InTouch.Mobile.iOS.csproj. The ItemGroup is contained in the InTouch.Mobile.iOS.csproj and not in the iOS.UI.csproj. This is confusing as it is the iOS.UI.csproj that fails to compile and not .iOS.csproj.

    Perhaps just a further suggestion as to the origin of the problem. I've had lots of problems in the previous version with working with Image Assets using Xamarin Studio and then opening that same project later on in Visual Studio 2015 to do some refactorings etc. using R#. The last time I looked VS 2015 was not able to handle Asset Libraries elegantly so you are forced to use XStudio for doing this. However, it seems like the changes been made by XStudio in the csproj is not always successfully ignored by VS 2015. I suspect this area to maybe be the source of these kinds of problems.

    Hope this gives some further clues as to what is going wrong.

    This worked for me also

  • MichelMoreiraMichelMoreira USMember ✭✭

    Those files are added when you save the assets catalogs within Xamarin.VS.

    I added a new file, and remembered that I should never manipulate the assets catalogs within Xamarin.VS, I already had all sorts of issues when I do that.

    @DavidStrickland0 said:
    Basically by deleting those from your project file your doing the same thing as just selecting the catalog in your project and removing it.

    Oh and for whats its worth Me to.

    Deleting the asset catalog isn't the same. You just need to remove those Contents.json from the csproj, you can leave the images.

  • ChrisApersChrisApers USMember

    Hi,

    For me, the project file was missing a line for the actual asset image. The entry for Contents.json was here but not the one for the ActionPlus.pdf contained in the same folder. Adding this line fixed my problem.

    <ImageAsset Include="Resources\Images.xcassets\ActionPlus.imageset\Contents.json" />
    <ImageAsset Include="Resources\Images.xcassets\ActionPlus.imageset\ActionPlus.pdf" /> <!-- MISSING LINE -->
    

    Hope this helps!

  • PhiluPhilu AUMember

    For me, the project file had to be edited manually; "BundleResource" had to be changed to "ImageAsset" for all image sets. Here's an excerpt of the changes:

    - <BundleResource Include="Resources\Images.xcassets\Contents.json" />
    - <BundleResource Include="Resources\Images.xcassets\myimage.imageset\Contents.json" />
    - <BundleResource Include="Resources\Images.xcassets\myimage.imageset\ipad_myimage.png" />

    + <ImageAsset Include="Resources\Images.xcassets\Contents.json" />
    + <ImageAsset Include="Resources\Images.xcassets\myimage.imageset\Contents.json" />
    + <ImageAsset Include="Resources\Images.xcassets\myimage.imageset\ipad_myimage.png" />

  • 3pa23pa2 USMember ✭✭

    Same problem :(

«1
Sign In or Register to comment.