Problem fixed, info at the bottom
The files in question are Addressable Assets (image(.png) and soundfile(.ogg)).
The Addressable Assets are bundled seperately.
I tried compression: Uncompressed and LZ4.
I tried compression Method for build: Default and LZ4HC
The program works when I test it via Visual Studio, only when I try to create the App Package does the error appear.
When I remove the image file from the project a different image file will be unable to be copied. The strange thing is that most of the files do get copied: In the data folder I have 73 images and in the build folder are 69.
I tried all architectures (64x 86x, ARM) and the error comes up for all of them, also the problematic file seems to be different most of the time. Sometimes none, one or both sound files are missing.
Error MSB3021 Unable to copy file “D:\Projects\Unity........\Data\StreamingAssets\aa\Unknown\WSAPlayer\images_assets_TestImage_a242dfaf7666dade35f01819e994dfb3.bundle”
to “D:\Projects\Unity......\build\obj..\Win32\Release\PackageLayout\Data\StreamingAssets\aa\Unknown\WSAPlayer\images_assets_TestImage_a242dfaf7666dade35f01819e994dfb3.bundle”.
Could not find a part of the path ‘D:\Projects\Unity..\Builds\HPP_WindowsStore\build\obj..\Win32\Release\PackageLayout\Data\StreamingAssets\aa\Unknown\WSAPlayer\images_assets_TestImage_a242dfaf7666dade35f01819e994dfb3.bundle’.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\Microsoft.AppXPackage.Targets
(Could not find a part of the path …)
I checked the path and the files are there.
I tried copying the missing files manually and it works (no permission blocks).
Interestingly after doing that I get this error:
Error MSB3231 Unable to remove directory "D:\Projects\Unity..\Builds..\build\obj..\ARM\Release\PackageUploadLayout".
Could not find a part of the path ‘MusicFile1_f9335b49f834a7d03c047f40312ebb06.bundle’.
I guess the builder tries to delete everything before rebuilding it and is somehow unable to get to that file.
Any suggestions on how to fix this?
Fix:
I removed the entire build folder and switched to “Master” both in Unity and Visual Studio and the problem is gone.
Edit: Ok the problem is back. I think it might have to do with deleting Assets for the Store. Some where too large so I deleted them. Deleting and rebuilding everything seems to solve it, still annoying though.