This struck me after upgrading IDE. The library was marked as installed but all library files for ArduinoJson were missing. After I removed and reinstalled the library my code compile again.