p.streef
p.streef

Reputation: 3815

android studio resourcebundle missingresourceexception

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?

Upvotes: 1

Views: 2197

Answers (1)

Stephan Richter
Stephan Richter

Reputation: 1156

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

Upvotes: 1

Related Questions