1

I have made a simple Android library for my personal use. Now I have to add some common string resources in the library module so that I can access them in the project wherever I use this library instead of creating the same string resources every time in every project I make.

But when I am trying to add a new string resource Android Studio is giving me an error saying:

"msg_example" is translated here but not found in default locale

I am not able to figure this out. Please help.

There is one similar question posted. But that does not resolves my issue. The answer says:

copy auth_strings.xml from values-en-rIN (locale values for INDIA you can use any locale) and paste it in default values folder.

According to the answer above, the person assumes that the developer is having a locale values directory like values-en-rIN and the string resources in it are getting the error. So he is asking to copy those string resources from that locale values directory to the default values directory which ultimately resolves the issue according to him.

But I don't have any other values directory than the default one. You can have a look in the following image:

enter image description here

So creating the string resources in it is giving me the error. My question is very simple and I have not done anything extra / wrong in the project which is giving me the error.

Hope you might have got the issue / difference between these two project scenarios.

Vaibhav Dhunde
  • 369
  • 1
  • 4
  • 15
  • Possible duplicate of ["auth\_client\_using\_bad\_version\_title" is translated here but not found in default locale](https://stackoverflow.com/questions/23821554/auth-client-using-bad-version-title-is-translated-here-but-not-found-in-defaul) – Zoe Nov 06 '18 at 18:01
  • @ Zoe - I went through that question which you have linked saying possible duplicate. But my scenario is not the same. Thanks! – Vaibhav Dhunde Nov 06 '18 at 18:04
  • I am not having any locale specific values folder. I am not able to create the string resources in the default values folder itself. – Vaibhav Dhunde Nov 06 '18 at 18:06
  • The answer in the link says to put the string resources from a locale values folder like (values-en-rIN) to default values folder. But I am already trying to create a string resource in the default values directory itself. Please note! – Vaibhav Dhunde Nov 06 '18 at 18:09
  • @VaibhavDhunde Can you post a screenshot for your strings.xml file and for your values folder heirarchy? – eyadMhanna Nov 06 '18 at 18:42
  • @ Zoe - So you / anyone could have asked me to provide the code / part of code that would help you / them understand the query in a better way instead of directly marking the question as possible duplicate. I have seen many questions on stackoverflow where people ask to provide more details if the don't get the exact issue posted by the person. – Vaibhav Dhunde Nov 06 '18 at 18:43
  • @EyadMhanna yes sure! – Vaibhav Dhunde Nov 06 '18 at 18:44
  • @EyadMhanna Please have a look at the screenshot – Vaibhav Dhunde Nov 06 '18 at 18:51
  • @VaibhavDhunde Can you please make an Invalidate Cache/Restart operation just to make sure that this is not Android Studio going nuts? – eyadMhanna Nov 06 '18 at 18:52
  • @EyadMhanna Ok. Will try and get back to you. Thanks! – Vaibhav Dhunde Nov 06 '18 at 18:56
  • @EyadMhanna Wow. That solved the issue. How silly, isn't it? :) – Vaibhav Dhunde Nov 06 '18 at 19:05
  • @EyadMhanna Thank you so much! :) – Vaibhav Dhunde Nov 06 '18 at 19:05
  • @Zoe Please remove the possible duplicate mark immediately as the query has been resolved by *EyadMhanna* and the issue scenario is different. – Vaibhav Dhunde Nov 06 '18 at 19:08
  • @EyadMhanna Please answer the question where I will be able to mark it as correct and people can vote it. Thanks! – Vaibhav Dhunde Nov 06 '18 at 19:10
  • @VaibhavDhunde Glad I could help! :) – eyadMhanna Nov 06 '18 at 19:14

1 Answers1

2

Since you don't have any other values folder than the default folder then I think it's not your fault with the error message you're facing, so I guess it's a problem with Android Studio. You can fix it by invalidating the cache of Android Studio and restarting it. You can do this from the main menu:

File -> Invalidate Cache / Restart... -> Invalidate and Restart

Happy Coding!

eyadMhanna
  • 2,412
  • 3
  • 31
  • 49