Open Foxcapades opened 6 months ago
Having this same issue on Mac. How do you rollback versions? I already updated to 0.1.22 .-.
Might be related to #28
In #28, Setting pathToUnityExe
was the workaround so I think Setting preferredUnityEditors
might work as workaround.
Setting pathToUnityExe
isn't working since it gets cleared again every time VPM is run, with preferredUnityEditors
I'm not really sure what I would set it to since it looks like it's supposed to be an object.
Having this same issue on Mac. How do you rollback versions? I already updated to 0.1.22 .-.
What I did was:
dotnet tool uninstall --global vrchat.vpm.cli
dotnet tool install --global vrchat.vpm.cli --version 0.1.20
For preferredUnityEditors
, You should set like this I think.
"preferredUnityEditors": {
"2019": "/Path/To/Unity2019",
"2022": "/Path/To/Unity2022"
},
I copied partially from settings.json on the windows.
Same issue :T (Here's what I have, just in case I'm putting a bad path:)
"preferredUnityEditors": {
"2022": "/Applications/Unity/Hub/Editor/2022.3.6f1/Unity.app/Contents/MacOS/Unity"
},
(Unity
at the end of that path is an executable binary.)
I have the same issue for the 2019 unity editor, with it overwriting the pathToUnityExe
when running vpm. The docs (https://vcc.docs.vrchat.com/vpm/cli/#check-hub) say that it runs this command for vpm check unity:
unityhub -- --headless editors -i
but the correct command for linux is this:
unityhub --headless editors -i
(as per https://docs.unity3d.com/hub/manual/HubCLI.html)
when running vpm check unity, it appears as if it runs the first command there, as it causes the hub to start up if it is not already running (and that's what happens if you manually run it in a terminal). they must have changed things so that it overwrites the path to the unity executable in those two newer vpm versions
in the old 0.1.20 version, it also cannot find the unity editor due to the above issue, but it does not wipe out that variable in the settings JSON file
welp, downgrading to 0.1.20 did not help for me and I was probably spouting nonsense in the post above. It still wipes out that path to unity exe when I try to make a new project :(
edit: oop 0.1.20 works fine. the path to the executable has to be an absolute path :+1:
The command on macOS is "./Unity Hub" -- --headless editors -i
, for those wondering. On my Mac, the Unity Hub executable is located at /Applications/Unity Hub.app/Contents/MacOS
.
I found that there are unity configuration in litedb file. it might be work well to add unity version to litedb?
Tried downgrading to 1.20 and updating pathToUnityExe, same issue
"pathToUnityExe": "/Applications/Unity/Hub/Editor/2022.3.6f1/Unity.app/Contents/MacOS/Unity",
Any solution yet?
I found the solution for this problem but this is extremely tricky solution.
Adding your unity editor to ${XDG_DATA_HOME}/VRChatCreatorCompanion/vcc.liteDb
(or${HOME}/.local/share/VRChatCreatorCompanion/vcc.liteDb
) will fix this problem.
The following C# code is used with LiteDB 5.0.17 from nuget to fix in my vcc.litedb. If you're familiar with C#, you can fix with this code.
// Edit FOLLOWING TWO LINES
// IF you don't have installed the unity version, set null to the variable.
var unity2019 = "/Applications/Unity/Hub/Editor/2019.4.31f1/Unity.app/Contents/MacOS/Unity";
var unity2022 = "/Applications/Unity/Hub/Editor/2022.3.6f1/Unity.app/Contents/MacOS/Unity";
// END OF EDIT AREA
var dataHome = Environment.GetEnvironmentVariable("XDG_DATA_HOME")
?? Environment.GetEnvironmentVariable("HOME") + "/.local/share";
var connect = new ConnectionString(dataHome + "/VRChatCreatorCompanion/vcc.liteDb");
using (var db = new LiteDatabase(connect))
{
if (unity2022 != null)
{
db.GetCollection("unityVersions").Insert(new BsonDocument()
{
{ "Path", unity2022 },
{ "Version", "2022.3.6f1" },
{ "LoadedFromHub", false }
});
}
if (unity2019 != null)
{
db.GetCollection("unityVersions").Insert(new BsonDocument()
{
{ "Path", unity2019 },
{ "Version", "2019.4.31f1" },
{ "LoadedFromHub", false }
});
}
}
I found the solution for this problem but this is extremely tricky solution.
Adding your unity editor to
${XDG_DATA_HOME}/VRChatCreatorCompanion/vcc.liteDb
(or${HOME}/.local/share/VRChatCreatorCompanion/vcc.liteDb
) will fix this problem.The following C# code is used with LiteDB 5.0.17 from nuget to fix in my vcc.litedb. If you're familiar with C#, you can fix with this code.
// Edit FOLLOWING TWO LINES // IF you don't have installed the unity version, set null to the variable. var unity2019 = "/Applications/Unity/Hub/Editor/2019.4.31f1/Unity.app/Contents/MacOS/Unity"; var unity2022 = "/Applications/Unity/Hub/Editor/2022.3.6f1/Unity.app/Contents/MacOS/Unity"; // END OF EDIT AREA var dataHome = Environment.GetEnvironmentVariable("XDG_DATA_HOME") ?? Environment.GetEnvironmentVariable("HOME") + "/.local/share"; var connect = new ConnectionString(dataHome + "/VRChatCreatorCompanion/vcc.liteDb"); using (var db = new LiteDatabase(connect)) { if (unity2022 != null) { db.GetCollection("unityVersions").Insert(new BsonDocument() { { "Path", unity2022 }, { "Version", "2022.3.6f1" }, { "LoadedFromHub", false } }); } if (unity2019 != null) { db.GetCollection("unityVersions").Insert(new BsonDocument() { { "Path", unity2019 }, { "Version", "2019.4.31f1" }, { "LoadedFromHub", false } }); } }
I initially thought that .liteDb file was empty because OneBella couldn't read it but after running your script Unity was finally recognized in vpm check unity
. Ty!
Describe the bug
NOTE This is a new behavior as of
0.1.21
and persists in0.1.22
.When executing VPM it does not use the editor as configured in the
settings.json
file. Instead, when executed it throws this error:Additionally, during execution it modifies the
settings.json
file and removes the value set to thepathToUnityExe
key.To Reproduce
Install VPM
Configure
~/.local/share/VRChatCreatorCompanion/settings.json
Execute
vpm new
.Expected behavior
(This output is tweaked from the
0.1.20
output to say^3.5.x
instead of^3.4.x
)Screenshots
Before execution![before](https://github.com/vrchat-community/creator-companion/assets/1297911/7982bae7-75c3-4d28-afd6-08580be3a59f)
After execution![after](https://github.com/vrchat-community/creator-companion/assets/1297911/60397cf1-bfcd-4467-8df2-19add4337742)
Related Product
VPM CLI
Product Version
0.1.21, 0.1.22
OS
macOS / Linux
Additional context
The workaround I have for now is:
0.1.20
vpm
./Packages/com.vrchat.*
directories from the project folder (as the older vpm installs outdated packages by default for some reason?)cd
into the project root directoryvpm resolve project
to install the correct versions of the packages