Returning to mega2560 project... MissingPackageManifestError: Could not find one of 'package.json' manifest files in the package

I am returning to a project that I have not built in a few years. During that time, I have had to reload my platformio system as I moved to new computers, etc. We discussed the processor I am using in this project and how to configure the variant file for it here:
How to initiate project for RobotDyn MCU-PRO Mega 2560 and I had that working just fine.

Now, years later, returning to this project folder and trying to build the project, I get the following issue: “MissingPackageManifestError: Could not find one of ‘package.json’ manifest files in the package” So I removed my .platformio/platforms/atmelavr folder and allowed the platform to be reinstalled when I restarted VSC. Now I continue to get this same error when I load the project which used to compile/build without issue.

The project folder has the variants folder and the appropriate pins_arduino.h in place. I am unclear what the package.json file is that the system is looking for.

How do I get unstuck here so I can continue to work on this project? THANKS!

my platformio.ini (which has not changed in years for this project):

[env:megaatmega2560]
platform = atmelavr
board = megaatmega2560
framework = arduino
board_build.variants_dir = variants
board_build.variant = mcupro
lib_ldf_mode = deep
lib_extra_dirs = ~/Documents/Arduino/libraries
lib_deps = 
	stevemarple/SoftWire@^2.0.4
	stevemarple/AsyncDelay@^1.1.2
	greiman/SSD1306Ascii@^1.3.2

I also tried deleting …/.platformio/platforms/atmelavr and then starting a new project for mega2560 board. This produces the following errors:

PIO Core Call Error: “The following files/directories have been created in C:\Users\peted\Documents\PlatformIO\Projects\MiniMegaTest\r\ninclude -
Put project header files here\r\nlib -
Put project specific (private) libraries here\r\nsrc -
Put project source files here\r\nplatformio.ini -
Project Configuration File\r\nResolving megaatmega2560 dependencies…\r\nPlatform Manager: Installing atmelavr\r\nUnpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%\r\n
Platform Manager: atmelavr@5.0.0 has been installed!\r\n\n\n
MissingPackageManifestError: Could not find one of ‘package.json’ manifest files in the package”

Is the atmelavr platform install broken???

The platformio.ini looks fine (given that variants/mcupro does exist in the project folder`).

If you’ve not modified PlatformIO files in C:\Users\<user>\.platformio, I would just go ahead and delete that folder and restart VSCode for a clean reinstall.

Yes, Max, my friend, I have tried that a few times… deleting …/.platformio/platforms/atmelavr
I even rebooted the PC before restarting VSC. I still get the following error when the platformio.ini file is read and it tries to install the platform.

Resolving megaatmega2560 dependencies...
Platform Manager: Installing atmelavr
Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Platform Manager: atmelavr@5.0.0 has been installed!
MissingPackageManifestError: Could not find one of 'package.json' manifest files in the package

Shouldn’t the platform package bring the package.json file with it during the installation?

and yes, double check,… I have variants\mcuprpins_arduino.h

Other things I can try? (I really don’t want to completely reinstall platformio if I can avoid it since I have several other platforms installed).

Thanks,
Pete

No, the whole .platformio folder.

Something somewhere is corrupted. I can build without the custom variant just fine.

[env:megaatmega2560]
platform = atmelavr
board = megaatmega2560
framework = arduino
;board_build.variants_dir = variants
;board_build.variant = mcupro
lib_ldf_mode = deep
lib_extra_dirs = ~/Documents/Arduino/libraries
lib_deps = 
	stevemarple/SoftWire@^2.0.4
	stevemarple/AsyncDelay@^1.1.2
	greiman/SSD1306Ascii@^1.3.2

Thanks Max. I had to be away from this for a few days and keep working on other processor platforms but I did finally uninstall .platformio last night and this morning reloaded that mega2650 project and everything loaded just fine and the build happened quickly.

Of course now, as I go to other platforms, I have to wait while each completely reloads, but I am back to being productive again. Thanks.

I would have liked to get to root cause so I can prevent this from happening again, but from a pragmatic point of view, it is acceptable to be moving forward with real work once again.

As always, thanks for a great set of software.