None of the above solutions worked for me. What finally worked was:
Instead of
import android.support.v4.content.FileProvider;
Use this
import androidx.core.content.FileProvider;
This path is updated as of AndroidX (the repackaged Android Support Library).