The issue actually seems to be optifine installed in a folder with a space in the name. I just finished the steps below and created a new .minecraft instance and downloaded and checked all my versions. Then I installed optifine which broke all game versions, even profiles without optifine. I had a hunch this might be the issue and renamed the folder removing the space character. I adjusted my launch script and launched Minecraft. Et voilà, what didn't work two minutes ago now did. Hope this solves your issue as well, make sure to remove all special characters from your folder names, if possible rename them to be as unproblematic as possible (e.g. not too long)
Hey, I had the same error and same situation (using --workDir parameter). However your workaround didn't work for me so the issue probably is a bit different, but I found out that it must have been my .minecraft folder making trouble. When I made the game create a new .minecraft folder it worked fine. The folder probably got corrupted somewhere when copying back and forth from C: to D:.
Somewhere in between I did delete the folders in the game directory (the directory with the minecraft.exe, not the workDir) as well but I'm not sure if that contributed to the fix.
Try modifying the workDir parameter to a directory that does not exist so it creates it. Launch a random version and see if the game works. If not try deleting all files in the game directory and create another workDir, then it should definitely work. I'm afraid you then will have to try and manually import your old profiles somehow, even thou you said you have a lot of them.
Edit: big oooof.
The issue actually seems to be optifine installed in a folder with a space in the name. I just finished the steps below and created a new .minecraft instance and downloaded and checked all my versions. Then I installed optifine which broke all game versions, even profiles without optifine. I had a hunch this might be the issue and renamed the folder removing the space character. I adjusted my launch script and launched Minecraft. Et voilà, what didn't work two minutes ago now did. Hope this solves your issue as well, make sure to remove all special characters from your folder names, if possible rename them to be as unproblematic as possible (e.g. not too long)
Hey, I had the same error and same situation (using --workDir parameter). However your workaround didn't work for me so the issue probably is a bit different, but I found out that it must have been my .minecraft folder making trouble. When I made the game create a new .minecraft folder it worked fine. The folder probably got corrupted somewhere when copying back and forth from C: to D:.
Somewhere in between I did delete the folders in the game directory (the directory with the minecraft.exe, not the workDir) as well but I'm not sure if that contributed to the fix.
Try modifying the workDir parameter to a directory that does not exist so it creates it. Launch a random version and see if the game works. If not try deleting all files in the game directory and create another workDir, then it should definitely work. I'm afraid you then will have to try and manually import your old profiles somehow, even thou you said you have a lot of them.