Media Plugin Error On API 29+

The media plugin uses Environment.getExternalStorageDirectory() which is deprecated on API level 29. I would like to know if there is some fix for this?