anatawa12 / VPMPackageAutoInstaller

An project to install vpm package published in non-official registry with unitypackage file.
MIT License
16 stars 2 forks source link

VPAI doesn't work in certain environments. #69

Closed Neuru5278 closed 5 months ago

Neuru5278 commented 5 months ago

On my machine, the same behavior always happened regardless of which version of the Unity Editor I was using, and even with newly created projects. It was the same for projects that existed directly under the drive.

System.FormatException: Input string was not in a correct format.
  at System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey) [0x0001a] in <eef08f56e2e042f1b3027eca477293d9>:0 
  at System.Number.ParseInt32 (System.ReadOnlySpan`1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info) [0x00016] in <eef08f56e2e042f1b3027eca477293d9>:0 
  at System.Byte.Parse (System.ReadOnlySpan`1[T] s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info) [0x00002] in <eef08f56e2e042f1b3027eca477293d9>:0 
  at System.Byte.Parse (System.String s) [0x00016] in <eef08f56e2e042f1b3027eca477293d9>:0 
  at Anatawa12.VrcGet.PartialUnityVersion.parse (System.String unityStr) [0x00032] in <ab933438f5d84e8dbea4f5baef604162>:0 
  at Anatawa12.VrcGet.PackageJson..ctor (Anatawa12.SimpleJson.JsonObj json) [0x00087] in <ab933438f5d84e8dbea4f5baef604162>:0 
  at Anatawa12.VrcGet.PackageVersions..ctor (Anatawa12.SimpleJson.JsonObj json) [0x0003e] in <ab933438f5d84e8dbea4f5baef604162>:0 
  at Anatawa12.VrcGet.Repository+ParsedRepository+<>c.<.ctor>b__4_0 (System.Object x) [0x00000] in <ab933438f5d84e8dbea4f5baef604162>:0 
  at Anatawa12.VrcGet.JsonUtils.ToDictionary[T] (Anatawa12.SimpleJson.JsonObj obj, System.Func`2[T,TResult] parser) [0x00026] in <ab933438f5d84e8dbea4f5baef604162>:0 
  at Anatawa12.VrcGet.Repository+ParsedRepository..ctor (Anatawa12.SimpleJson.JsonObj json) [0x00057] in <ab933438f5d84e8dbea4f5baef604162>:0 
  at Anatawa12.VrcGet.Repository..ctor (Anatawa12.SimpleJson.JsonObj cache) [0x00006] in <ab933438f5d84e8dbea4f5baef604162>:0 
  at Anatawa12.VrcGet.LocalCachedRepository..ctor (Anatawa12.SimpleJson.JsonObj json) [0x00018] in <ab933438f5d84e8dbea4f5baef604162>:0 
  at Anatawa12.VrcGet.RepoHolder.load_repo (Anatawa12.VrcGet.Path path, System.Net.Http.HttpClient http, System.Func`1[TResult] if_not_found) [0x00199] in <ab933438f5d84e8dbea4f5baef604162>:0 
  at Anatawa12.VrcGet.RepoHolder.load_remote_repo (System.Net.Http.HttpClient client, System.Collections.Generic.Dictionary`2[TKey,TValue] headers, Anatawa12.VrcGet.Path path, System.String remote_url) [0x000ab] in <ab933438f5d84e8dbea4f5baef604162>:0 
  at Anatawa12.VrcGet.RepoHolder.LoadUserRepo (System.Net.Http.HttpClient client, Anatawa12.VrcGet.UserRepoSource source) [0x00090] in <ab933438f5d84e8dbea4f5baef604162>:0 
  at Anatawa12.VrcGet.RepoHolder.load_repo_from_source (System.Net.Http.HttpClient client, Anatawa12.VrcGet.RepoSource source) [0x00066] in <ab933438f5d84e8dbea4f5baef604162>:0 
  at Anatawa12.VrcGet.RepoHolder+<>c__DisplayClass2_0.<load_repos>b__0 (Anatawa12.VrcGet.RepoSource src) [0x00070] in <ab933438f5d84e8dbea4f5baef604162>:0 
  at Anatawa12.VrcGet.RepoHolder.load_repos (System.Net.Http.HttpClient http, System.Collections.Generic.IEnumerable`1[T] sources) [0x0008d] in <ab933438f5d84e8dbea4f5baef604162>:0 
  at Anatawa12.VrcGet.Environment.load_package_infos (System.Boolean update) [0x0008a] in <ab933438f5d84e8dbea4f5baef604162>:0 
  at Anatawa12.VpmPackageAutoInstaller.VpmPackageAutoInstaller.DoInstallImpl () [0x002a5] in <ab933438f5d84e8dbea4f5baef604162>:0 
  at Anatawa12.VpmPackageAutoInstaller.SyncedTask`1[TResult].Execute () [0x00015] in <ab933438f5d84e8dbea4f5baef604162>:0 
  at Anatawa12.VpmPackageAutoInstaller.VpmPackageAutoInstaller.DoInstall () [0x00019] in <ab933438f5d84e8dbea4f5baef604162>:0 
UnityEngine.Debug:LogError (object)
Anatawa12.VpmPackageAutoInstaller.VpmPackageAutoInstaller:DoInstall ()
Anatawa12.VpmPackageAutoInstaller.VpmPackageAutoInstaller/<DoAutoInstall>d__3:MoveNext ()
UnityEngine.UnitySynchronizationContext:ExecuteTasks ()

If I defined the variable unity_str on line 95 of Structs.cs in vrcGetCs as an arbitrary constant, it worked fine. So what's wrong with me?

I tested with the file below https://booth.pm/ja/items/4915091

anatawa12 commented 5 months ago

Umm... It looks there is some invalid vpm repository (vpm repository with invalid package.json) in your pc.

I heard that com.mmmaellon.plate-tectonics 3.0.2 has such a package.json (in vrc-get/vrc-get#546). I'm going to fix VPAI side.