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.
...
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
- Having
Shake.setEnableActivityHistory(true)
- Tap anywhere.
- Trigger a Shakebug and read the report, it has many "Invalid resource ID"
Touch tracking floods with
Invalid resource ID 0x…on React Native appsDescription
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.
Environment
@shakebugs/react-native-shakecom.shakebugs:shake(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.
Reproduce
Shake.setEnableActivityHistory(true)