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.

It seems device dependent, Pixel (8a, 9 pro) and Samsung (S21) are reporting them, but it does not appear with Honor 200

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 a little bit anywhere, scroll some views.
  3. Trigger a Shakebug and read the report, it has many "Invalid resource ID"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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