Is it possible to create a new folder in Android Studio to use images without encountering 'Unresolved reference' errors?

huangapple go评论69阅读模式
英文:

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中创建自己的文件夹并从那里使用这些图片吗?

项目外观和错误:
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
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?

Project look and errors:
Is it possible to create a new folder in Android Studio to use images without encountering 'Unresolved reference' errors?

答案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.

huangapple
  • 本文由 发表于 2023年5月22日 21:52:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/76306903.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定