Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

file:///android_res/drawable not working when using flavor with other package name

Tags:

My problem is that after I added flavors to my project the flavor with a package name different from the actual source seems to have problems with accessing the files in android_res/drawable.

More specifically I have a html-view that calls the following image.

<img src="file:///android_res/drawable/image.png">

The image shows up in the production flavor that has the package name which is the same as the directory of the java-files but it doesn't work for the beta flavor:

productFlavors {
    production {
        packageName "com.company.myapp"
    }

    beta {
        packageName "com.company.beta"
    }
}

where the actual directory with the java files is

java/com/company/myapp

It is rather strange that this happens since the resources are not even in that folder.