最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Added mp3 files to my Android project raw folder but it broke all my Drawable folder resources - Stack Overflow

programmeradmin10浏览0评论

Need help to fix my project.

I added some mp3 files to my raw folder. The folder already holds many .json files. The mp3 file names were wrongly structured, they had capitals letters. After adding the mp3 files, the files in the drawable folder become "Unresolved reference" resources. The R.string. resources also turn "Unresolved"

All the R.drawable.* and R.string.* in the MainActivity.kt are "Unresolved reference", but every other *.kt file the same drawables and strings are found successfully.

I do not know why the drawable and strings resources got damage anyway since I only touched the raw folder.

I have 100 or more drawables.

I removed the mp3 files but still the project can't see the drawables.

I "Invalidate Caches", "Clear Project" build, but still can't see the drawables.

I tried moving the files to drawable-v34 (my target sdk is 34 minimum 26), but still can't see the drawables.

I am using Android Studio Ladybug | 2024.2.1 Patch 2

What should I do? What information should I post here for you to help me?

Need help to fix my project.

I added some mp3 files to my raw folder. The folder already holds many .json files. The mp3 file names were wrongly structured, they had capitals letters. After adding the mp3 files, the files in the drawable folder become "Unresolved reference" resources. The R.string. resources also turn "Unresolved"

All the R.drawable.* and R.string.* in the MainActivity.kt are "Unresolved reference", but every other *.kt file the same drawables and strings are found successfully.

I do not know why the drawable and strings resources got damage anyway since I only touched the raw folder.

I have 100 or more drawables.

I removed the mp3 files but still the project can't see the drawables.

I "Invalidate Caches", "Clear Project" build, but still can't see the drawables.

I tried moving the files to drawable-v34 (my target sdk is 34 minimum 26), but still can't see the drawables.

I am using Android Studio Ladybug | 2024.2.1 Patch 2

What should I do? What information should I post here for you to help me?

Share Improve this question edited Nov 18, 2024 at 20:25 jetberrocal asked Nov 18, 2024 at 20:19 jetberrocaljetberrocal 1471 silver badge10 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

I found the cause of the problem.

While adding the mp3 files I also added code to use the mp3's.

val soundEntry: Int = soundpool.load(context, R.raw.mp3file, 1)

That made the Android Studio to auto import android.R

I though of removing the question as this was my error, but decided to leave it for other naive programmers like me that will experience this error and not lost there mind.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论