[android] FileProvider - IllegalArgumentException: Failed to find configured root

Got similar problem after enabled flavors (dev, stage).

Before flavors my path resource looked like this:

<?xml version="1.0" encoding="utf-8"?>
<paths>
    <external-path
    name="my_images"
    path="Android/data/pl.myapp/files/Pictures" />
</paths>

After added android:authorities="${applicationId}.fileprovider" in Manifest appId was pl.myapp.dev or pl.myapp.stage depends on flavor and app started crashing. I removed full path and replaced it with dot and everything started working.

<?xml version="1.0" encoding="utf-8"?>
<paths>
    <external-path
        name="my_images"
        path="." />
</paths>