Android content res resources notfoundexception drawable resource id

Crash Android 4.4: Resources$NotFoundException: File res/drawable/abc_vector_test.xml #457

Comments

thierryfornetti commented Apr 28, 2017

Hello, sometimes I get a crash of Resources$NotFoundException on android API19.
It’s related to Vector Drawable, it’s not supported in android lower than 5 unless you use a gradle version major than 1.4. Here is a similar issue.

I verified that by changing the gradle version of this library the crash doesn’t appear, can you please change gradle version on build.gradle to the latest version (or at least something major than 1.4.0-beta3)?

The text was updated successfully, but these errors were encountered:

nigelnindo commented May 11, 2017

Seconding @thierryfornetti here. I did run into some issues a while back with the react native’s Switch component where the app would crash on API19. Moving to gradle version 2.1.2 solved this.

I’m running into the same issue on API19 as explained above. Can the gradle version used in this project be upgraded?

ksegla commented May 21, 2017 •

+1. I’ve been having this exact same issue too.

sibelius commented Jul 12, 2017

anybody solved this?

iam-mrinmoy commented Jul 17, 2017

if you use android studio 3 canary version then you will get this error for the
gradle version(mine was 3.0.0-alpha6).
i opened the project on android studio 2.3.3 and changed the gradle version to 2.3.3 and run the app on api 19/16/25 emulator . works just fine.

ancyrweb commented Aug 1, 2017

Still happening, totally randomly.

lukaleli commented Aug 11, 2017 •

Same here on API level 17:

devboy commented Sep 7, 2017

ancyrweb commented Sep 8, 2017

Sounds like a problem with the Switch component. As I’ve removed them this problem disappeared.

thierryfornetti commented Sep 8, 2017

The gradle version has been changed with commit 48a02b9, changed from 1.1.3 to 2.3.+.

Didn’t have time to test it, but it should be solved with version 4.3.0 of this library.

oblador commented Sep 8, 2017

Can we close this one? I’m not even sure this library ever was to blame, I suspect that people assume it is because it has vector in the error.

thierryfornetti commented Sep 12, 2017

Ok, I did my test with a tablet with Android API19, these are the result:

  • with react-native-vector-icons v4.2.0:
    • without changing build:gradle: ERROR
    • by changing build:gradle only for react-native-vector-icons (from 1.1.3 to 2.2.3): ERROR
    • by changing build:gradle fo all libraries (set it >1.4, I used 2.2.3): not showing the error, but one time I got the error even in this case
  • with react-native-vector-icons v4.3.0: no matter what I try, the error always appear
Читайте также:  Сони плеер андроид 4пда

I found a way to reproduce this error, it’s a very odd sets of operation (login, send chat message, logout, signup with a new account), of course it’s a very random error and based on the things you do it can appear in different places for different reasons.
Every time I did a test, I always run a gradlew clean to delete the old app from my pc, close the terminal of React Native and uninstall the app from the tablet, so there shouldn’t be any leftovers.

I’m pretty sure back then I could solve the problem by only changing the build:gradle of this library, in the meanwhile I updated a lot of libraries and I changed from React Native 0.38.1 to 0.42.3. Maybe I was wrong back then or maybe the new libraries changed the behaviour, it’s hard to say.

I’m sure it’s all related to the way React Native merge the gradle version of all the libraries, by manually changing the grade version of your libraries it appears that sometimes can be enough to solve the problem.

This doesn’t exactly close the issue, but the grade version now it’s updated and that’s good, no idea about why with the new version it appears as if the problem can’t be solved anymore.

Источник

android.content.res.Resources$NotFoundException: Resource ID #0x7f020052 #2966

Comments

dinomonster commented Mar 13, 2017

Description

I have a issue,here is the log:

Robolectric & Android Version

robolectric 3.3
android 25

The text was updated successfully, but these errors were encountered:

jongerrish commented Mar 14, 2017

Robolectric is not able to look up a resource for the application resource ID provided.

If you put a breakpoint here:-

You can check every resource directory passed to the app and ensure that it exists. The most likely explanation is that your resource directories are not being found.

What build system are you using?

Can you point us to a git repo which demonstrates this problem?

Please reopen if we can help further.

haoyubihai commented Mar 15, 2017

I have the same problem, like this :

android.content.res.Resources$NotFoundException: Unable to find resource ID #0x7f060072 in packages [com.gaiay.businesscard, android]

Process finished with exit code 255

While ,in my app ,the line 100 code is:

boolean mDebugMode = «true».equals(getString(R.string.debug_mode));

the string «debug_mode» what i configured in my build.gradle,like this :

buildTypes.all < type ->
def typeName = name.replace(«_leak», «»)
type.resValue(«string», «debug_mode», «rc».equals(typeName) ? «false» : «true»)
>

MinkiPan-zz commented Mar 17, 2017

I have the exact same issue, how can I fix this?

slott commented Jun 15, 2017 •

I’m having the same bad experience as well.

android.content.res.Resources$NotFoundException: Resource ID #0x7f020052

And this resource is

Not sure if that is of any significance.

vagrawal13 commented Jun 17, 2017

+1. Running into the same issue:
roboelectric version: 3.4.-rc1
targetsdk = 23

belporto commented Jun 20, 2017

I was having the same problem. Just did this:

Everything is working now :).

slott commented Aug 17, 2017

Doing the above makes absolutely no difference to my project. 😭

omar25h commented Aug 19, 2017

anyone got it to work? I have the same issue

brettchabot commented Aug 21, 2017

For those having issues, could you please provide more details about what build system (gradle version, AS studio version etc) you are using, and ideally provide a sample project we can use to repro the problem.

Читайте также:  Инструкция по сборке android ядра

Note that there is a known issue with AS studio 3.0 beta 2 re not finding resources. See https://issuetracker.google.com/issues/62290260

tir38 commented Aug 30, 2017 •

Looks like we’ll have to wait for AS 3.0.0-beta4 for a fix.

brettchabot commented Aug 30, 2017

Per my earlier comment: for those still having problems please file a new issue with more details. Gradle version, Android studio version, Robolectric version, etc) you are using, and ideally provide a sample project we can use to repro the problem

The Android gradle plugin 3.0 beta 3 should have fixed the known issue about resources not found when running tests within Android Studio.

A good starting point for sample code is the Robolectric deckard sample: https://github.com/robolectric/deckard

slott commented Sep 2, 2017 •

@brettchabot I’m getting the error when ever I define application = MyApplication.class. Just tried running Roboelectric on a new small project without too much junk in the application class — and that works just fine.

If I have time I can dig into what exactly inside MyApplication is causing the issue.

omar25h commented Sep 2, 2017

@tir38 AS Beta 4 is released an I confirm it solves my problem regarding ResourcesNotFoundException

jongerrish commented Sep 8, 2017

I’m going to close this because the issue encompasses various unrelated issues.

For AGP 3.0 the latest version of AS+Gradle is working for the main use cases. Exceptions are where the user specifies a different package name in their Gradle file, this is an issue with AGP, follow here:- https://issuetracker.google.com/65398093

For issues with resources not found on AGP

Suraj-Anbhule commented Feb 25, 2018 •

android.content.res.Resources$NotFoundException: Resource ID #0x1
at android.content.res.Resources.getValue(Resources.java:2596)
at android.support.v7.widget.AppCompatDrawableManager.loadDrawableFromDelegates(AppCompatDrawableManager.java:330)
at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:195)
at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:188)
at android.support.v7.content.res.AppCompatResources.getDrawable(AppCompatResources.java:100)
at android.support.v7.widget.AppCompatImageHelper.setImageResource(AppCompatImageHelper.java:85)
at android.support.v7.widget.AppCompatImageView.setImageResource(AppCompatImageView.java:94)
at myfriendapp.suraj.com.myfriendlistapp.MainActivity$MyAdapter.getView(MainActivity.java:61)
at android.widget.AbsListView.obtainView(AbsListView.java:2937)
at android.widget.ListView.makeAndAddView(ListView.java:1945)
at android.widget.ListView.fillDown(ListView.java:719)
at android.widget.ListView.fillFromTop(ListView.java:785)
at android.widget.ListView.layoutChildren(ListView.java:1735)
at android.widget.AbsListView.onLayout(AbsListView.java:2731)
at android.view.View.layout(View.java:17993)
at android.view.ViewGroup.layout(ViewGroup.java:5817)
at android.support.constraint.ConstraintLayout.onLayout(ConstraintLayout.java:1197)
at android.view.View.layout(View.java:17993)
at android.view.ViewGroup.layout(ViewGroup.java:5817)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:344)
at android.widget.FrameLayout.onLayout(FrameLayout.java:281)
at android.view.View.layout(View.java:17993)
at android.view.ViewGroup.layout(ViewGroup.java:5817)
at android.support.v7.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:443)
at android.view.View.layout(View.java:17993)
at android.view.ViewGroup.layout(ViewGroup.java:5817)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:344)
at android.widget.FrameLayout.onLayout(FrameLayout.java:281)
at android.view.View.layout(View.java:17993)
at android.view.ViewGroup.layout(ViewGroup.java:5817)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1742)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1494)
at android.view.View.layout(View.java:17993)
at android.view.ViewGroup.layout(ViewGroup.java:5817)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:344)
at android.widget.FrameLayout.onLayout(FrameLayout.java:281)
at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:3146)
at android.view.View.layout(View.java:17993)
at android.view.ViewGroup.layout(ViewGroup.java:5817)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2755)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2456)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1524)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7520)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
at android.view.Choreographer.doCallbacks(Choreographer.java:686)
at android.view.Choreographer.doFrame(Choreographer.java:622)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7325)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

gradle version 4.5
android studio 3.2

Источник

android.content.res.Resources$NotFoundException: File res/drawable-v21/launch_background.xml #383

Comments

Megidd commented Dec 4, 2020 •

Describe the bug

Previously I was building and running fine. I don’t remember making any change, but recently, I run into such errors while building and running the app on a Samsung Galaxy Note 3 through Android Studio:

Flutter doctor
Copy and paste the output of flutter doctor -v here

To Reproduce
Steps to reproduce the behavior:

  1. Git checkout master branch
  2. Open Android Studio
  3. Connect your Android smartphone device to computer through USB port
  4. Click the green triangle to build and run the app on the device
  5. Error are thrown on terminal

Expected behavior
No error or exception is expected. The app should build and run fine on the device.

Screenshots

Desktop information:

  • OS: Windows 10
  • Browser Opera
  • Version:72.0.3815.400

Smartphone information:

  • Device: Samsung Galaxy Note 3
  • OS: Android 5.0
  • Browser Opera
  • Version 60.3.3004.55692

Additional context
Such posts show that maybe the Gradle build system needs to be configured differently, not sure:

The text was updated successfully, but these errors were encountered:

Источник

Ресурсы Android $ NotFoundException: Идентификатор ресурса # 0x7f030027

Я работал над своей программой для Android и, когда я пытался ее протестировать, я вдруг начал получать сообщение об ошибке «android.content.res.Resources $ NotFoundException: Идентификатор ресурса # 0x7f030027» Последнее крупное изменение, которое я сделал, заключалось в добавлении в панель действий через В библиотеке поддержки, но я уже получил эту работу. Кроме того, я добавил один новый класс, но даже если я удалю класс и связанные с ним файлы, ошибка все же появляется. Я пробовал очистить проект и перезапустить Eclipse несколько раз безрезультатно.

Читайте также:  Саунд пад для андроид

Вот трассировка стека в случае, если что-то потеряно в переводе:

Также я проверил файл R.java, и ресурс определенно существует, хотя, как я упоминал, очистка проекта, удаление R-файла и перезапуск Eclipse ничего не делает. Одна вещь, о которой я думаю, следует упомянуть, однако, что я нашел два файла R.java, один из которых находится в папке проекта вместе с BuildConfig.Java. Другой – в android.support.v7.appcompat. Я знаю, что appcompat может вызвать некоторые проблемы, поэтому я думал, что это стоит упомянуть на всякий случай.

Я даже не могу заставить свой код работать так, как он привык, поэтому любая помощь будет оценена и дайте мне знать, нужна ли вам какая-либо другая информация!

Вы можете проверить свой R-файл для Resources$NotFoundException: Resource ID #0x7f030027 . Он скажет вам, какой ресурс создает проблему. Как альтернативное решение, я думаю, что у вас может быть setText или любой контент только int И, как вы знаете, компилятор будет искать соответствующее значение ресурса. Итак, просто конкат пустую строку там, как «»

В моем случае произошла ошибка после обновления до Android Studio build: 3.0 Canary 6, я исправил ее, переведя ее на предыдущую версию 3.0 Canary-5 и создав инструменты canary-5.

Проблема связана с некоторой несовместимостью с векторными чертежами на api 19 и ниже

EDIT: похоже, что упомянутая проблема была решена на Android Studio build: 3.0 Canary 7

Это тоже проблема.

Но оказалось, что я перемещал вещи в своей среде IDE, я неправильно переместил ресурс макета (xml) из каталога макета в макет .

Это сработало после того, как я вернул его.

Надеюсь, это поможет кому-то.

Для меня при создании файла макета он приземлился в папке layout-land и, следовательно, исключении. Надеюсь, это поможет кому-то.

A) может быть ошибка в любом из ваших xml-файлов ресурсов (строки, макеты, анимация и т. Д.), А ваш.package.name.R не может скомпилировать с этой ошибкой

Ошибка: apostrophe ‘ должен предшествовать обратная косая черта \

Исправление:

B) Вы ввели неправильный «R» в свой класс. Убедитесь, что вы импортируете your.package.name.R а не your.package.name.R android.R

Исправление:

Надеюсь, это поможет, Happy Coding!

Я получаю это исключение:

Android.content.res.Resources $ NotFoundException: Идентификатор ресурса # 0x7f02004f

Я звонил в PNG Icon из … \ app \ src \ main \ res \ drawable-21

Когда я помещаю свой PNG Icon в … \ app \ src \ main \ res \ drawable, и я называю это,
Моя проблема уходит

BTW XML работал с \drawable-21

Посмотрите на эту ссылку, возможно, это поможет вам, это та же проблема. Если очистка проекта не поможет вам удалить файл r.java, он будет сгенерирован сам. Получение android.content.res.Resources $ NotFoundException: исключение, даже если ресурс присутствует в android

Вероятно, вы разрабатываете новую версию Android с вашего текущего устройства. Попробуйте загрузить SDK, подходящий для вашего тестового устройства.

Если вы используете векторный drawable в resource.xml, который имеет в API версии 19 или ниже, вы получите это исключение

В моем случае я использовал собственный стиль для своей вертикальной полосы прокрутки в виде прокрутки следующим образом:

И мой стиль был таким:

Я изменил первую часть:

И добавил родителя в стиль, подобный этому:

И проблема решена.

Вы можете вызывать строку из ресурсов проекта с помощью

Который относится к глобальным ресурсам. Чтобы ссылаться на ваши ресурсы проекта, выполните getString () непосредственно из вашей деятельности:

Источник

Оцените статью