Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Couldn't resolve resource" in Android Studio's Preview

After adding new items in strings.xml, quite often they don't start working immediately in Android Studio's Preview.

Couldn't resolve resource @string/faq_customer_service

Preview looks like this:

enter image description here

I've obviously tried to re-build the project, and even run gradle clean assembleDebug, but it doesn't seem to help. On emulator & real device the newly-added string resources do work.

Any trick to force Android Studio to reload the resources so that the correct texts show up in Preview?

like image 650
Jonik Avatar asked Oct 17 '13 14:10

Jonik


2 Answers

The only reliable way I've found so far is reloading the project / restarting Android Studio.

Quickest way to do that is File → Invalidate caches / Restart... → Just Restart.

Feel free to post better solutions!

like image 161
Jonik Avatar answered Sep 17 '22 16:09

Jonik


you DO NOT need to close the entire project. It's just way too much for so little problem.

Just refresh the preview (click the "refresh" button) refresh button arrow

provided from https://stackoverflow.com/a/34754707/3339597

like image 43
Re'em Avatar answered Sep 18 '22 16:09

Re'em