aviation_hacker
aviation_hacker

Reputation: 1

android.content.res.Resources$NotFoundException: Unable to find resource ID #0xffffffff?

I'm trying to repair an old android app that I've been using for years (not the original developer). I've got all the other issues fixed (yay! By pure luck almost) and I'm running into this issue, where it seems to have an issue getting the ResourceEntryName? Unfortunately I can't figure out exactly what's wrong with it and where it's throwing the error apart from the line references given, nor am I particularly java/android dalvik familiar either, so I may be out of my depth on this one.

I've double checked as many of the obvious resource issues that I could find in terms of specific references (maneuvers etc, as it's designed to take data from Maps notifications and display them on a Pebble Watch), and have also tried reordering the order that it getID's and getResources as some of the other issues were to do with the order things were executed in, due to the application parsing notification data to then display on the watch - no practical difference here, and depending on the order these were loaded in it came back with Fatal Errors so I've put them back to original using a backup file. Also tried commenting out the line as well, results in the app crashing and a Fatal Error, same with removing the integer in brackets as well. Another thread suggested moving the drawables into the base drawable folders rather than version specific eg. drawable-v23 but that didn't make a difference either, nor did moving layout files incase there was one missing/in another folder.

Any help/suggestions you could provide would be appreciated! I did have a search through on similar errors, and the causes seemed to be rather wide ranging and application specific, so I thought it best to ask my own question instead. I've attached both the LogCat that's throwing the error (seems to repeat pretty frequently in the logs, but doesn't affect functionality seemingly at all?) and also the code from the .smali file in question.

Thanks in advance! :)

04-08 21:43:14.890 25573 27081 E corp.pebble.nav: No package ID ff found for ID 0xffffffff.
04-08 21:43:14.890 25573 27081 D NotificationHandler: getResources failed
04-08 21:43:14.890 25573 27081 D NotificationHandler: android.content.res.Resources$NotFoundException: Unable to find resource ID #0xffffffff
04-08 21:43:14.890 25573 27081 D NotificationHandler:   at android.content.res.ResourcesImpl.getResourceEntryName(ResourcesImpl.java:289)
04-08 21:43:14.890 25573 27081 D NotificationHandler:   at android.content.res.Resources.getResourceEntryName(Resources.java:2335)
04-08 21:43:14.890 25573 27081 D NotificationHandler:   at com.batescorp.pebble.nav.lib.NotificationHandler.a(SourceFile:259)
04-08 21:43:14.890 25573 27081 D NotificationHandler:   at com.batescorp.pebble.nav.lib.NotificationHandler.a(SourceFile:333)
04-08 21:43:14.890 25573 27081 D NotificationHandler:   at com.batescorp.pebble.nav.lib.NotificationHandler.a(SourceFile:333)
04-08 21:43:14.890 25573 27081 D NotificationHandler:   at com.batescorp.pebble.nav.lib.NotificationHandler.a(SourceFile:333)
04-08 21:43:14.890 25573 27081 D NotificationHandler:   at com.batescorp.pebble.nav.lib.NotificationHandler.a(SourceFile:27)
04-08 21:43:14.890 25573 27081 D NotificationHandler:   at com.batescorp.pebble.nav.lib.NotificationHandler$1.run(SourceFile:210)
04-08 21:43:14.890 25573 27081 D NotificationHandler:   at java.lang.Thread.run(Thread.java:1012)
# instance fields
.field private a:Ljava/lang/String;
.line 67
    const-string v0, ""

    iput-object v0, p0, Lcom/batescorp/pebble/nav/lib/NotificationHandler;->a:Ljava/lang/String;
.line 259
    :try_start_1
    invoke-virtual {p2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v4

    invoke-virtual {v1}, Landroid/view/View;->getId()I

    move-result v5

    invoke-virtual {v4, v5}, Landroid/content/res/Resources;->getResourceEntryName(I)Ljava/lang/String;
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    move-result-object v0

    move-object v4, v0
.line 333
    check-cast v1, Landroid/view/ViewGroup;

    invoke-direct {p0, p1, p2, v1}, Lcom/batescorp/pebble/nav/lib/NotificationHandler;->a(Landroid/content/Context;Landroid/content/Context;Landroid/view/ViewGroup;)Ljava/lang/String;

    goto/16 :goto_1

Upvotes: -1

Views: 551

Answers (1)

aviation_hacker
aviation_hacker

Reputation: 1

So, referencing the Android Developer Website, I managed to change the getResourceEntryName element to GetResourceName and then had a look at the LogCat - what were previously the ResourceEntryNames I'm supposing changed to android:id/EntryName due to how the application logging would append it all together.

So in this case, it looks like there isn't a global issue with the code itself (the rest seem to work fine), but it instead has to do with a particular element it is retrieving not having an ID, hence the issue appearing in the logs.

Upvotes: 0

Related Questions