No Resources found that matches the given name

The error in the title is a very common error encountered in Android. There are several common reasons why this could happen. For example,

1. The resource is really missing from (say) a string resource file.

2. The SDK target is set to a version below the required version etc.

However, there is another common reason why this error occurs in IntelliJ – because the dependent or library project is *not* marked as a library project, in addition to including it in the list of module dependencies. This happens frequently while importing existing Android projects into IntelliJ. To resolve this issue, first check if the dependent project is a library project as follows:

1. Open Module Settings in IntelliJ

2. Select the ‘Android Icon’ below the library module.

3. Mark the “Library module” check box selected. Select Save.

Without step #3, Intellij will NOT see resources from a library project, even if the library project has been marked as a dependent module in the main project.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s