admin管理员组文章数量:1432573
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 badges1 Answer
Reset to default 0I 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.
本文标签:
版权声明:本文标题:Added mp3 files to my Android project raw folder but it broke all my Drawable folder resources - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745596284a2665501.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论