Skip to content

Log noise since updates #21

Description

@fdrault

Touch tracking floods with Invalid resource ID 0x… on React Native apps

Description

After an update of react native 0.86.2 and shake-bugs to 17.2.2, we have many noise in the reported log on Android.

14270:14270 E/ce.app.internal: Invalid resource ID 0x000039ca.
14270:14270 E/ce.app.internal: Invalid resource ID 0x000039c6.
...
Image

Environment

@shakebugs/react-native-shake 17.2.2
com.shakebugs:shake (Android) 17.2.2
React Native 0.86.2, New Architecture (Fabric), Hermes
Build release (minified), Android

Impact

Noise only, no functionnal difference

Suggested fix

I am not expert on the android part but as far as I understand, it comes from using Resources.getResourceEntryName

ID values generated at build time by aapt for R.id does not have any name, so it throws and is captured by Shakebugs internally.

Found this in AOSP line 61. You can detect generated ID Values with the same byte mask, and not lookup for names for these, because it will always fail.

inline bool is_valid_resid(uint32_t resid) {
  return (resid & 0x00ff0000u) != 0 && (resid & 0xff000000u) != 0;
}

Reproduce

  1. Having Shake.setEnableActivityHistory(true)
  2. Tap anywhere.
  3. Trigger a Shakebug and read the report, it has many "Invalid resource ID"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions