VST: setStateInformation() is not called after updated to JUCE 4

Hi, after my VST plugin is updated to JUCE 4 (VST SDK is also updated), when opening projects saved from previous versions, all parameters are lost. I debug it and find setStateInformation() is not called at all. Does anyone have a clue? Save & Load with same version works fine.

Which host?

Tested on Cubase and Studio One, both failed.

Clearly the hosts don’t think it’s the same plugin. Maybe a name or ID or version descriptor has changed.

Yes. But the weird thing is that when the older version loads a project saved from newer version, all parameters are there.

You probably need to set JUCE_VST_RETURN_HEX_VERSION_NUMBER_DIRECTLY=1 in the user part of your AppConfig.h. Without that, the newer JUCE will produce a version number of, e.g., instead of for Cubase and some other hosts, which will make Cubase think that version is newer than version (and therefore it won’t load the settings saved with the “older” version).

Yes! It works!