googlesamples / unity-jar-resolver

Unity plugin which resolves Android & iOS dependencies and performs version management
Other
1.22k stars 339 forks source link

[Bug] GvhProjectSettings.xml changes/resets itself #524

Closed ManuelRauber closed 1 month ago

ManuelRauber commented 2 years ago

[REQUIRED] Please fill in the following fields:

[REQUIRED] Please describe the issue here:

Sometimes, not really reproducible, the file GvhProjectSettings.xml changes/resets itself. This is super annoying, because the file pops up in the git stage:

image

As well as this dialogs pops up all the time

image

And as you can see from the diff file above, the settings get reset, e.g. I've disabled both auto-resolution on build and in editor and it will reset back to true, because that's the default.

I currently can not reproduce it exactly, when it happens. Sometimes it does not happen all day, sometimes it happens multiple times day.

google-oss-bot commented 2 years ago

This issue does not seem to follow the issue template. Make sure you provide all the required information.

paulinon commented 2 years ago

Hi @ManuelRauber,

Could you provide the steps you've performed before facing this issue so that we can identify what's causing this behavior?

faveris commented 2 years ago

I have the same issue. I've just installed External Dependency Manager with one of SDKs and these things start to happen. Looks like it happens after recompilation but not after each one. Also sometimes after exiting playmode.

Unity editor version: 2021.3.3f1 External Dependency Manager version: 1.2.169 Source you installed EDM4U: .unitypackage Features in External Dependency Manager in use: Android Resolver Platform you are using the Unity editor on: Mac

ghost commented 2 years ago

We are facing same issue on Unity: 2021.3.4f1 Editor: Mac (Silicon)

ManuelRauber commented 2 years ago

Hi @ManuelRauber,

Could you provide the steps you've performed before facing this issue so that we can identify what's causing this behavior?

Unfortunately, I can not answer this, because I simply use the Unity Editor. Sometimes I just open it and then I see a change in git and the file has been written as shown in the first post.

Sometimes that does not happen, I have no clear way to reproduce this behavior.

Currently, I'm carefully looking whenever this change happens, but I've not found a clear way yet.

belike81 commented 2 years ago

Having the exact same issue. Reset happens every few minutes. Makes it very, very difficult to not accidentally commit the changed file (which breaks the build).

Unity: 2021.3.4f1 Editor: Mac (Silicon) External Dependency Manager version: 1.2.170 Source you installed EDM4U: .unitypackage Features in External Dependency Manager in use: iOS Resolver Platform you are using the Unity editor on: Mac

paulinon commented 2 years ago

Hi folks,

Does disabling auto-resolution prevent this issue from happening? The Android Resolver automatically keeps track of the differentdependencies you have specified in your Unity project. The resolution process runs when the specified dependencies are not present in your project.

faveris commented 2 years ago

Does disabling auto-resolution prevent this issue from happening?

For me issue is happening with auto-resolution turned off

belike81 commented 2 years ago

Does disabling auto-resolution prevent this issue from happening?

Same as above - it's turned off, but the issue is still occurring. Judging by all the reports seems to be mac specific.

google-oss-bot commented 2 years ago

Hey @ManuelRauber. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

ManuelRauber commented 2 years ago

Hey @ManuelRauber. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

Well, Google Bot, we can not add more information, because we don't have more information.

I still have no way that I do to reproduce it.

It just popped up after updating a Unity Package via Package Manager. To test, I reverted the changes in git and updated the unity package again. This time, the GvhProjectSettings.xml did not change. No clue, sorry.

I'd love to help to investigate the issue, but since I can not cleary reproduce it, it's hard to track.

paulinon commented 2 years ago

Thanks for the update, folks. I'll bring this up with the team so that we can analyze this behavior. In the meantime, could you try our latest version of the resolver (1.2.172) to make sure the issue persists?

google-oss-bot commented 2 years ago

Hey @ManuelRauber. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot commented 2 years ago

Since there haven't been any recent updates here, I am going to close this issue.

@ManuelRauber if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

chorobochrontochor commented 1 year ago

Hey, this is still present in EDM4U v1.2.172. GvhProjectSettings file is getting reset from time to time like @ManuelRauber described.

OS: Mac M1 (Silicon) Unity Editor: 2021.3.4f1 EDM4U: 1.2.172 (installed via Package Manager)

ManuelRauber commented 1 year ago

Thanks for the update, folks. I'll bring this up with the team so that we can analyze this behavior. In the meantime, could you try our latest version of the resolver (1.2.172) to make sure the issue persists?

Any news? Also, could you reopen the issue? It's still present. :) @paulinon

google-oss-bot commented 1 year ago

Since there haven't been any recent updates here, I am going to close this issue.

@ManuelRauber if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

ManuelRauber commented 1 year ago

Since there haven't been any recent updates here, I am going to close this issue.

@ManuelRauber if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

I just did exactly that...

tikotus commented 1 year ago

I also have this issue on macos. I managed to work around this issue by setting the file non-writeable, but now I get three exceptions on every recompile as the plugin is trying to write to the file. To me it seems odd that anything is trying to write to the file on recompile, so these exceptions should proably not be occurring? Maybe one of these stack traces can help you figure out why the file is being reset occasionally?

Unable to write to 'ProjectSettings/GvhProjectSettings.xml' (System.UnauthorizedAccessException: Access to the path "/x/ProjectSettings/GvhProjectSettings.xml" is denied. at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x0019e] in <e38a6d3ee47c43eb9b2e49c63fc0aa48>:0 at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options) [0x00000] in <e38a6d3ee47c43eb9b2e49c63fc0aa48>:0 at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean useAsync) [0x00000] in <e38a6d3ee47c43eb9b2e49c63fc0aa48>:0 at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,bool) at System.Xml.XmlWriterSettings.CreateWriter (System.String outputFileName) [0x00051] in <38dbe8c56cdd4466b240eacd29d4a366>:0 at System.Xml.XmlWriter.Create (System.String outputFileName, System.Xml.XmlWriterSettings settings) [0x0000a] in <38dbe8c56cdd4466b240eacd29d4a366>:0 at Google.ProjectSettings.Save () [0x000a1] in Z:\tmp\tmp.CJxVZ8zZsI\third_party\unity\unity_jar_resolver\source\VersionHandlerImpl\src\ProjectSettings.cs:828 , Project settings were not saved! UnityEngine.Debug:LogError (object) Google.Logger:Log (string,Google.LogLevel) (at Z:/tmp/tmp.CJxVZ8zZsI/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/Logger.cs:136) Google.ProjectSettings:Save () (at Z:/tmp/tmp.CJxVZ8zZsI/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/ProjectSettings.cs:844) Google.ProjectSettings:SetBool (string,bool,Google.SettingsLocation) (at Z:/tmp/tmp.CJxVZ8zZsI/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/ProjectSettings.cs:485) Google.ProjectSettings:SetBool (string,bool) (at Z:/tmp/tmp.CJxVZ8zZsI/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/ProjectSettings.cs:497) Google.IOSResolver:set_VerboseLoggingEnabled (bool) (at Z:/tmp/tmp.cmxLSGC2UL/third_party/unity/unity_jar_resolver/source/IOSResolver/src/IOSResolver.cs:998) Google.IOSResolver:.cctor () (at Z:/tmp/tmp.cmxLSGC2UL/third_party/unity/unity_jar_resolver/source/IOSResolver/src/IOSResolver.cs:692) UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes (System.Type[]) (at /Users/bokken/buildslave/unity/build/Editor/Mono/EditorAssemblies.cs:126)

Unable to write to 'ProjectSettings/GvhProjectSettings.xml' (System.UnauthorizedAccessException: Access to the path "/x/ProjectSettings/GvhProjectSettings.xml" is denied. at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x0019e] in <e38a6d3ee47c43eb9b2e49c63fc0aa48>:0 at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options) [0x00000] in <e38a6d3ee47c43eb9b2e49c63fc0aa48>:0 at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean useAsync) [0x00000] in <e38a6d3ee47c43eb9b2e49c63fc0aa48>:0 at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,bool) at System.Xml.XmlWriterSettings.CreateWriter (System.String outputFileName) [0x00051] in <38dbe8c56cdd4466b240eacd29d4a366>:0 at System.Xml.XmlWriter.Create (System.String outputFileName, System.Xml.XmlWriterSettings settings) [0x0000a] in <38dbe8c56cdd4466b240eacd29d4a366>:0 at Google.ProjectSettings.Save () [0x000a1] in Z:\tmp\tmp.CJxVZ8zZsI\third_party\unity\unity_jar_resolver\source\VersionHandlerImpl\src\ProjectSettings.cs:828 , Project settings were not saved! UnityEngine.Debug:LogError (object) Google.Logger:Log (string,Google.LogLevel) (at Z:/tmp/tmp.CJxVZ8zZsI/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/Logger.cs:136) Google.ProjectSettings:Save () (at Z:/tmp/tmp.CJxVZ8zZsI/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/ProjectSettings.cs:844) Google.ProjectSettings:SetBool (string,bool,Google.SettingsLocation) (at Z:/tmp/tmp.CJxVZ8zZsI/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/ProjectSettings.cs:485) Google.ProjectSettings:SetBool (string,bool) (at Z:/tmp/tmp.CJxVZ8zZsI/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/ProjectSettings.cs:497) Google.VersionHandlerImpl:set_VerboseLoggingEnabled (bool) (at Z:/tmp/tmp.CJxVZ8zZsI/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/VersionHandlerImpl.cs:2514) Google.VersionHandlerImpl:LoadLogPreferences () (at Z:/tmp/tmp.CJxVZ8zZsI/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/VersionHandlerImpl.cs:2293) Google.VersionHandlerImpl:<VersionHandlerImpl>m__0 () (at Z:/tmp/tmp.CJxVZ8zZsI/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/VersionHandlerImpl.cs:2304) Google.RunOnMainThread:ExecuteNext () (at Z:/tmp/tmp.CJxVZ8zZsI/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:486) Google.RunOnMainThread:<ExecuteAllUnnested>m__1 () (at Z:/tmp/tmp.CJxVZ8zZsI/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:536) Google.RunOnMainThread:RunAction (System.Action) (at Z:/tmp/tmp.CJxVZ8zZsI/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:343) Google.RunOnMainThread:ExecuteAllUnnested (bool) (at Z:/tmp/tmp.CJxVZ8zZsI/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:530) Google.RunOnMainThread:ExecuteAll () (at Z:/tmp/tmp.CJxVZ8zZsI/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:512) UnityEditor.EditorApplication:Internal_CallUpdateFunctions () (at /Users/bokken/buildslave/unity/build/Editor/Mono/EditorApplication.cs:356)

Unable to write to 'ProjectSettings/GvhProjectSettings.xml' (System.UnauthorizedAccessException: Access to the path "/x/ProjectSettings/GvhProjectSettings.xml" is denied. at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x0019e] in <e38a6d3ee47c43eb9b2e49c63fc0aa48>:0 at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options) [0x00000] in <e38a6d3ee47c43eb9b2e49c63fc0aa48>:0 at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean useAsync) [0x00000] in <e38a6d3ee47c43eb9b2e49c63fc0aa48>:0 at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,bool) at System.Xml.XmlWriterSettings.CreateWriter (System.String outputFileName) [0x00051] in <38dbe8c56cdd4466b240eacd29d4a366>:0 at System.Xml.XmlWriter.Create (System.String outputFileName, System.Xml.XmlWriterSettings settings) [0x0000a] in <38dbe8c56cdd4466b240eacd29d4a366>:0 at Google.ProjectSettings.Save () [0x000a1] in Z:\tmp\tmp.CJxVZ8zZsI\third_party\unity\unity_jar_resolver\source\VersionHandlerImpl\src\ProjectSettings.cs:828 , Project settings were not saved! UnityEngine.Debug:LogError (object) Google.Logger:Log (string,Google.LogLevel) (at Z:/tmp/tmp.CJxVZ8zZsI/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/Logger.cs:136) Google.ProjectSettings:Save () (at Z:/tmp/tmp.CJxVZ8zZsI/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/ProjectSettings.cs:844) Google.ProjectSettings:SetBool (string,bool,Google.SettingsLocation) (at Z:/tmp/tmp.CJxVZ8zZsI/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/ProjectSettings.cs:485) Google.ProjectSettings:SetBool (string,bool) (at Z:/tmp/tmp.CJxVZ8zZsI/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/ProjectSettings.cs:497) Google.PackageManagerResolver:set_VerboseLoggingEnabled (bool) (at Z:/tmp/tmp.NQek55Y74t/third_party/unity/unity_jar_resolver/source/PackageManagerResolver/src/PackageManagerResolver.cs:647) Google.PackageManagerResolver:<PackageManagerResolver>m__0 () (at Z:/tmp/tmp.NQek55Y74t/third_party/unity/unity_jar_resolver/source/PackageManagerResolver/src/PackageManagerResolver.cs:97) Google.RunOnMainThread:ExecuteNext () (at Z:/tmp/tmp.CJxVZ8zZsI/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:486) Google.RunOnMainThread:<ExecuteAllUnnested>m__1 () (at Z:/tmp/tmp.CJxVZ8zZsI/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:536) Google.RunOnMainThread:RunAction (System.Action) (at Z:/tmp/tmp.CJxVZ8zZsI/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:343) Google.RunOnMainThread:ExecuteAllUnnested (bool) (at Z:/tmp/tmp.CJxVZ8zZsI/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:530) Google.RunOnMainThread:ExecuteAll () (at Z:/tmp/tmp.CJxVZ8zZsI/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:512) UnityEditor.EditorApplication:Internal_CallUpdateFunctions () (at /Users/bokken/buildslave/unity/build/Editor/Mono/EditorApplication.cs:356)

uniquecorn commented 1 year ago

Also experiencing this issue on multiple macs, all apple silicon.

viktorcode commented 1 year ago

Thanks to @tikotus call stack we now can find part of the problem:

    /// <summary>
    /// Initialize the module.
    /// </summary>
    static IOSResolver() {
        // Load log preferences.
        VerboseLoggingEnabled = VerboseLoggingEnabled;

It's a convoluted way to set the logging level from the stored value from static constructor. The setter for VerboseLoggingEnabled however changes the settings as well as changing the log level. So that causes settings file to be overwritten.

Would be nice for Google to clean up their mess by setting the logging level explicitly, not as a side effect of the property setter.

uniquecorn commented 1 year ago

Thanks to @tikotus call stack we now can find part of the problem:

    /// <summary>
    /// Initialize the module.
    /// </summary>
    static IOSResolver() {
        // Load log preferences.
        VerboseLoggingEnabled = VerboseLoggingEnabled;

It's a convoluted way to set the logging level from the stored value from static constructor. The setter for VerboseLoggingEnabled however changes the settings as well as changing the log level. So that causes settings file to be overwritten.

Would be nice for Google to clean up their mess by setting the logging level explicitly, not as a side effect of the property setter.

Screenshot 2022-08-01 at 4 58 46 PM

Happens for other resolvers as well.

firstIssue commented 1 year ago

Just to keep this thread alive. Still happening all the time... get your things together Google or/and Unity

uniquecorn commented 1 year ago

bumping again

JonLandmark commented 1 year ago

This is happening all the time to my team and me. It seems to randomly change the values in that file while developing

ikitae commented 1 year ago
Screenshot 2022-11-28 at 5 34 39 PM Screenshot 2022-11-28 at 5 40 31 PM

The GvhProjectSettings.xml file is initialized whenever the source code is modified. with annoying pop-ups

firstIssue commented 1 year ago

So I was creating a script that resets the resolve before building. Tested it only a little, but this might give some help to some people here. You basically need a template XML, you gonna use with the settings you like.

So set your settings as you like in the resolver settings, then copy that XML as template and use this script:

` public class PreprocessBuild : IPreprocessBuildWithReport { public int callbackOrder { get { return 0; } } public static ProcessStartInfo processStartInfo = new ProcessStartInfo();

public void OnPreprocessBuild(BuildReport report)
{
    switch (report.summary.platform)
    {
        case BuildTarget.Android:
            ProcessAndroid("../");
            break;
    }
}

protected static void ProcessAndroid(string pathToProject)
{
    //Reset the project settings first for the resolver
    string template = "../YourProject/Assets/Scripts/Build/Editor/GvhProjectSettingsTemplate.xml";
    string file = "../YourProject/ProjectSettings/GvhProjectSettings.xml";
    string templateContent = File.ReadAllText(template);

    File.WriteAllText(file, templateContent);

    UnityEngine.Debug.Log("<color=#00ff00>Preprocess Android Resolver on path: " + file + "</color>");

    //Now get all plugins that may have be made and remove them
    string androidPluginPath = Path.Combine(Application.dataPath, "Plugins/Android");

    UnityEngine.Debug.Log("<color=#00ff00>Delete plugins from " + androidPluginPath + "</color>");

    List<string> aarFiles = System.IO.Directory.GetFiles(androidPluginPath, "*.aar", SearchOption.AllDirectories).ToList();
    List<string> jarFiles = System.IO.Directory.GetFiles(androidPluginPath, "*.jar", SearchOption.AllDirectories).ToList();
    int filesTotal = aarFiles.Count + jarFiles.Count;

    UnityEngine.Debug.Log("<color=#00ff00>Deleted " + filesTotal.ToString() + " plugins.</color>");

    foreach (string filepath in aarFiles)
        System.IO.File.Delete(filepath);

    foreach (string filepath in jarFiles)
        System.IO.File.Delete(filepath);
}

}`

CodeMasterYi commented 1 year ago

Haha, I make GvhProjectSettings.xml readonly. shot It wont change now!!! regardless red error text in console, everything else stay normal. Shuang!

CodeMasterYi commented 1 year ago

after android force resolve it show resolution success and print this error image

Why write this file.=.= why write error content into it!

CodeMasterYi commented 1 year ago

ATTENTION: I intend to modify the permission of GvhProjectSettings.xml 'cause I dont want it changed any more! @paulinon

uniquecorn commented 1 year ago

This is still a problem in 2023.

kyubuns commented 1 year ago

This is happening on the latest 2021LTS as well. I do a git checkout every time and revert it back, but I don't know what the best practice is.

lenarakhmadeev commented 1 year ago

Still no solution?

CodeMasterYi commented 1 year ago

This is happening on the latest 2021LTS as well. I do a git checkout every time and revert it back, but I don't know what the best practice is.

I make it readonly now!!! dirty solution. but no other workaround.

cameronnotdoppler commented 1 year ago

We have this issue with v1.2.174 on Unity 2021.3.16f, it resets itself regularly and is very annoying. I'm on apple silicone M1. Please fix, if this change is accidentally commited to source control it breaks our builds.

StuWebstMW commented 1 year ago

Also seeing this with v1.2.175 on Unity 2021.3.17f1

CodeMasterYi commented 1 year ago

@cameronnotdoppler @StuWebstMW Before they fix this issue, you guys can make the file readonly. then you can see error output in the console every time that it try to modify the file. Haha.

CodeMasterYi commented 1 year ago

@IRod22 Are you seriously? Hardware-specific? But my mac is Intel chip. I believe it is just an logic issue.

ghost commented 1 year ago

Never mind

HarrisonBeachey commented 1 year ago

Hey @paulinon is there word on this getting fixed in an update? Still seeing this on v1.2.175 in unity 2022.2.4f1

Tommigun1980 commented 1 year ago

Hi. It'd be good to get this fixed. We have all the auto resolutions etc. off, but every time I open the project it tries to either add or remove a <projectSetting /> block:

<?xml version="1.0" encoding="utf-8"?>
<projectSettings>
  <projectSetting /> <--- this line gets added and removed randomly on every boot of Unity
  <projectSetting name="com.google.external-dependency-managerAnalyticsEnabled" value="False" />
  ...

Alternatively it resets the entire file so that it contains just an empty projectSettings tag.

Tommigun1980 commented 1 year ago

In addition, even when the resolver does not add/remove the empty projectSettings block it always edits the GvhProjectSettings.xml file when Unity is opened. So clearly it rewrites the contents on every boot and probably on every play in editor as well. This makes iterating projects unnecessarily slow. In addition it always checks out the GvhProjectSettings.xml file so version control always tries to check in the file (with or without changes) for every single person who ever opens the project, every single time.

I will clearly have to revert to my old hack of disabling the editor dlls when not in use, but it would be preferable if they worked in a non-intrusive manner. Opening your project is in the critical path so this should clearly be resolved.

Thank you.

Tommigun1980 commented 1 year ago

Is there any movement on this issue? We have disabled auto resolution, yet GvhProjectSettings.xml gets corrupted several times per day (it gets completely cleared) for everyone on the team, and after that the resolver starts asking everyone if they want to enable the resolver (the exact same popup as the OP posted).

Repro is to add the resolver to your project and open the Unity project.

This is a fatal issue in my mind, so would like to know if it will get fixed or if I should add workarounds. I need to stress that opening your Unity project is in the critical path so it would be greatly appreciated if the resolver worked.

Tommigun1980 commented 1 year ago

This is a nightmare as not only does Unity check out the file every time Unity is opened, but for some reason the file's contents constantly reset. Completely out of the blue, while you are working in the Unity editor, the file resets itself.

Could this please be fixed? It has a really negative impact on everyone's workflow.

Tommigun1980 commented 1 year ago

@paulinon You said at https://github.com/googlesamples/unity-jar-resolver/issues/579#issuecomment-1341310290 that the team is investigating. This is an absolute workflow killer, so is there any resolution coming soon? Repro step is to add the resolver to a Unity project and open the project.

Tommigun1980 commented 1 year ago

@paulinon @chkuang-g

This has to be fixed. Everyone on a team having to write-protect GvhProjectSettings.xml is not a proper solution. When do you guys think a fix will land?

Vasiliy-Medvid commented 1 year ago

How much longer can this bug be tolerated? This bug is a real spoke in the wheels of the normal workflow. This bug must be fixed!

shreks7 commented 1 year ago

It still happens on 1.2.176

uniquecorn commented 1 year ago

I wrote my own simple resolver and I'm free of this issue. For Android, it's very easy to search for the XML files and write the dependencies into the maintemplate gradle file. For iOS, running pod install programmatically is the iffy part, making the podfile is easy. Only runs when building too which I thought might not work because unity wouldn't reimport the gradle file but it does! I would open source it but I only implemented the features for my use case so no exploding aars or settings for androidx or jetifier. One thing to look out for is that other plugins are gonna complain that EDM4U doesnt exist and try to install it, worst case would be they just start throwing exceptions.

uniquecorn commented 1 year ago

Open sourced: https://github.com/RapBot-Studios/CustomDependencyManager