Android instance app feature module fails to find a layout resource in the same module

Viewed 2223

I have the following project structure which I want to convert to a instant apps. The installed project works fine, but when I want to runt the instant app version, the base feature module loads perfectly, but when it comes to the feature module, then it fails to find the resources from its module. When I move the resources from feature module to base module, then it recognizes them with the full package name of the base feature module.

The project structure is the following: - app module - instant app module
- base feature module - com.app.base.feature - feature module - com.app.feature.

in feature module when the resource is located in feature module itself the resources are not found, but they are found when I move the resource into the base feature module and reference them as following com.app.base.feature.R.layout.sample_layout.

EDIT: No known package when getting value for resource number 0x80060009.

Any kind of help would be appreciated :)

4 Answers

I found this problem similar problem when I created a project with Instant App and Kotlin support without Support Library. The Android Studio intellisense din't add the correct import for the Resources. So, I changed that import:

import com.company.awesomeapp.feature.R

For this:

import com.company.awesomeapp.R

And everything worked fine. My thought is: for modular apps, the intellisense doesn't know what is the correct reference, so, the project broken in the compile time.

Related