1

I'm trying to migrate from eclipse to Android studio. After some work I got my app to build but I get a missingresourcefileexception.

I have my achievements.properties file in the src folder of my app. Which runs fine when I build and run in eclipse.

In android studio however I get the following exception:

04-14 21:02:09.657  16105-16152/com.bla E/AndroidRuntime﹕ FATAL EXCEPTION: GLThread 37579
Process: com.streefgames.rotatris.android, PID: 16105
java.util.MissingResourceException: Can't find resource for bundle 'achievements_en', key ''
        at java.util.ResourceBundle.missingResourceException(ResourceBundle.java:238)
        at java.util.ResourceBundle.getBundle(ResourceBundle.java:230)
        at java.util.ResourceBundle.getBundle(ResourceBundle.java:159)
        at com.streefgames.rotatris.helpers.StringResourceManager.<init>(StringResourceManager.java:18)

I have tried moving my resource file around, adding resource files to make a bundle, different locales and all the other things I found. But it is still not working. Any idea what's wrong?

p.streef
  • 3,652
  • 3
  • 26
  • 50

1 Answers1

1

Try creating a resources folder within your src/main folder and place the properties file there. This resources folder can be created via the context menu (New > Folder > Java Resources Folder). It worked for me. I found this hint at Android Studio - Include ResourceBundles in Module

Community
  • 1
  • 1
Stephan Richter
  • 1,139
  • 11
  • 31
  • Note that it is also possible to simply add an existing resource folder (see my [answer at the related question](https://stackoverflow.com/a/45985134/905686)) instead of creating a new one. – user905686 Aug 31 '17 at 17:22