How to fix locked Library/SourceAssetsDB file? - c#

I am collaborating with 4 other members on an unity project, when I pulled the last version of the game, I tried to open it in unity. I got an error saying "The project you are opening contains a locked Library/SourceAssetsDB file".
Error
I couldn't find any relevant information on the internet.
I went into the project folder to see if maybe one file is enabled on read/write-only but this was false. Here a screenshot of the project folder, I am not sure if the file "SourceAssetDB-lock" is always there, that's why I post it here.
Project Structure

Related

Multiple script and namespace errors on a previously working Unity project . Type or namespace name 'GUIColorOverride' could not be found

I had some unusual errors on a relatively small Unity project with six c# scripts written in Visual Studio. It was all working fine, and I came back to it after the weekend. Upon opening, there were 18 new errors which were preventing the code from compiling and I spent several hours trying to figure out what was going on.
The main errors were saying things like Type or namespace name 'GUIColorOverride' could not be found and associated script cannot be loaded, assign a valid script, even though they were linked and I could see the scripts had no errors in Visual Studio. I even did a full Unity uninstall and rebooted, then a clean install. This didn't fix it.
I tried a number of other things such as backing up the scripts from the assets folder and then deleting them. Opening the project and pasting them back in as 'clean' new scripts. This didn't work. I am using Unity's Cloud Collab so was even able to use this to go back to earlier pushes of the project (which had all worked). Nope.
Solved it! The issue was that the local Projects folder I had been using was connected to Google Backup and Sync. This messed with some of the files in some of the folders in PackageCache in Particular in the MyProject > Library > PackageCache > com.unity.timeline#1.2.13 > Editor > directory.
[FIX] To fix and prevent this from happening in future, I turned off Google Backup and Sync for my Unity Project(s), and am now exclusively using Unity Collab and Git. Using the specific errors that were showing in the Unity console, I located the exact path of the Unity-created files that were causing these errors in my broken project, and replaced them with the same files from a working project. This fixed all of the errors. There must have been some corrupted or partially synced files in these folders which caused Unity to have a tantrum. Hope that helps someone!
You should exclude these from the Backup!
Basically you can exclude anything that would also be excluded from git via e.g. this "official" .gitignore file for Unity projects.
Any file and folder listed here will be regenerated by Unity automatically and should not appear in any version control / Backup.
The entire Library folder in particular is part of it since its content changes quite rapidly and is recompiled every time you change a script, install/remove a package etc.
Checkout Unity Manual - Behind the Scenes for more information in detail
When backing up a project, or adding a project to a Version Control Repository, you should include the main Unity project folder, containing both the Assets
and ProjectSettings folders. All the information in these folders is crucial to the way Unity works. You should omit the Library and Temp folders for backup purposes.
To solve an already present issue with the Library folder you can most of the times fix it by simply closing Unity, deleting the entire Library folder via your file browser and opnening Unity again → Unity will rebuild the Library

Xamarin project has seemingly lost reference to Mono for Android

I was having many errors with my Xamarin project not being able to recognize the Android namespace and read that the solution was to delete the contents of the /bin folder and let it re-build from scratch.
I did that and now I am getting the error here: . The only thing I've found is that a small number of other people have had this error and there is no solution in their threads. Under references the path to Mono.Android.dll is correct (C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v8.0\Mono.Android.dll), and the file exists. I can remove the reference and re-add it and will still see the same error.
Does anyone know how I can fix this and get back to my previous set of mysterious time-consuming Xamarin errors?

Unable to create a manifest resource name for

I've made a git rebase from master on the branch I'm working and after that every time I try to build my project it doesn't, and is showing me an error message, actually is showing several error messages but I think they are related to this one:
Unable to create a manifest resource name for
Migrations\24534563454_SomeFile.resx. Could not find file
'SomePath\MyProject\Migrations\24534563454_SomeFile.cs'
I've restarted VS, clean my project and rebuild it but the error persists.. maybe this has to do with the .csproj file? What should I do?
Following the link suggested by #kennyzx in the comment and the responses on that link, I saw that there was a yellow warning icon in the file within the Migrations folder in the Solution Explorer. I deleted that file and now it built correctly

My C# program says one of my files can't be found, the file that is connected to my SQL database

My C# program was running until I moved them around and now, it says I one of the forms can't be found. Attached are the warnings. I have tried everything so I'm afraid I'll have to manually edit the code... for the hundredth time... The missing form IS in the project folder, still it says the form can't be found. This form can't be re written because it's the one that's connected to my sql server.
Copy the project in other folder
Delete the debug folder and try to reload the project
if you get any message exclude the the debug folder
Rebuild the project
I hope this will work.
check all the paths and references you set are correct or clear all references and then give reference again. this is absolutely a path issue.
that's it.

"The path .. would result in a file outside the App Bundle and cannot be used" Error, mono touch / Xamarin

i am currently facing a really weird and annoying error message after migrating my Xamarin.IOS - Project to the 64bit unified - API. The exact error message is:
/Users/falcowinkler/Dev/AHK_App -Kopie/AHK_App_iOS/../ahk_app_ios/resources/.DS_Store:
Error: The path '../ahk_app_ios/resources/.DS_Store' would result
in a file outside of the app bundle and cannot be used. (AHK_App_iOS).
I get that error not only for .DS_Store but also for two other files.
Here are the things i tried.
Clean / Rebuild
delete bin / obj Folder and rebuild
I deleted the files that throw the error, just to get another message that the project is missing these files. I added them again after that, and got the same error as above again
I tried moving my project to other locations, but the error does not change in the slightest.
I tried to remove all problematic files, before migrating, which didn't work as well.
Does anybody know where all the file references are stored in Xamarin, so i can view/edit them to find out what the error is?
I mean the DS_Store file is just a tiny file from mac - finder architecture, is not even necessary for my project, but still it is referencing it, i will just have to kick out these references i guess.
If anybody encountered these issues as well, and has a solution, pls leave a quick post here, thanks :)
Update
I am now pretty sure that there are some misplaced references to files in my project, i saw a similar issue on git hub. But how can i wipe them out? I tried removing my entire resources Folder and adding it again, but it didn't help either. Error message now looks as follows:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets:
Error: Bundle Resource '../ahk_app_ios/resources/.DS_Store'
not found on disk (should be at '/Users/falcowinkler/Documents/AHKKopie/ahk_app_ios/resources/.DS_Store') (AHK_App_iOS)
If anyone else has this problem, just search your project files for the filename. The .csproj File will appear, where you will be able to wipe out the reference to the file, causing the problem.
If you are using Xamarin Studio, you can delete the .DS_Store under your Ios project [ProjectName.iOS] under the Resources folder

Categories

Resources