android studio resourcebundle missingresourceexception

a 夏天 提交于 2019-12-11 04:49:32

问题


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?


回答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



来源:https://stackoverflow.com/questions/29635462/android-studio-resourcebundle-missingresourceexception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!