英文:
Is it possible to create a new folder in Android Studio to use images without encountering 'Unresolved reference' errors?
问题
Unresolved reference: father_and_son_2258681
我导入了R文件,当我点击图片时,Android Studio可以看到所有图片,但当我点击运行时,会出现30个"Unresolved reference"错误。图片已导入并位于drawable-thx文件夹中。如果我将它们移动到drawable文件夹中,那么一切都可以编译无误,但只有mipmap-xxhdpi等文件夹不起作用。可以在res中创建自己的文件夹并从那里使用这些图片吗?
英文:
Unresolved reference: father_and_son_2258681
I imported R folder and while i click on the image, android studio sees all images, however when i click run, i get 30 errors "Unresolved reference". Images were imported and are in folder drawable-thx. If I move them to drawable they it all compiles flawlessly, but only there mipmap-xxhdpi and etc. doesn't work as well. Can create own folder in res and use the images from there?
答案1
得分: 1
你的可绘制资源目录名称无效。它应该是drawable
,或者(更常见的情况是)drawable
后面跟着有效的资源集合限定符。-thx
不是一个有效的资源集合限定符,因此构建系统不会识别drawable-thx
。
英文:
You have an invalid directory name for drawable resources. It needs to be drawable
, or (more commonly) drawable
followed by valid resource set qualifiers. -thx
is not a valid resource set qualifier, so drawable-thx
is not going to be recognized by the build system.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论