Modern Androids heavily restrict access to the file system, and getting file URLs is no longer allowed. I suspect you have bumped target SDK when upgrading and now you are bound by newer rules from Android: you'll have to upgrade your code to use storage providers and permissions.
Some info: https://developer.android.com/training/data-storage and https://developer.android.com/guide/topics/providers/document-provider