React-native: Error while updating property 'accessibilityRole' of a view managed by:RCTView

Created on 29 Jan 2020  路  16Comments  路  Source: facebook/react-native


Hi I am getting following error. PFA

Error while updating property 'accessibilityRole' of a view managed by:RCTView
null
Invalid accessibility role value:tab

React Native version:
React Native Environment Info:
System:
OS: macOS 10.15.2
CPU: (4) x64 Intel(R) Core(TM) i5-5350U CPU @ 1.80GHz
Memory: 53.47 MB / 8.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.14.1 - ~/.nvm/versions/node/v12.14.1/bin/node
npm: 6.13.4 - ~/.nvm/versions/node/v12.14.1/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
Android SDK:
API Levels: 28, 29
Build Tools: 28.0.3, 29.0.2
System Images: android-28 | Google APIs Intel x86 Atom_64, android-28 | Google Play Intel x86 Atom, android-29 | Google APIs Intel x86 Atom
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.6010548
Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.3 => 16.6.3
react-native: ^0.59.10 => 0.59.10

Screenshot 2020-01-28 at 11 15 18 AM

Author Feedback Repro Verify on Latest Version

Most helpful comment

Hi everyone, I figured out with temporary solution actually. Here what is:

I set react-native-tab-view version 2.7.0 with hardcoded in package.json. Not "^2.7.0", because if you set like this it's downloading 2.13.0 from npm, which had actual problem.

react-native-gesture-handler version 1.3 and react-native-reanimated version 1.2 which re compatible with 2.7.0 because it's latest version before Android X version as this 3rd party libraries. So problem basically fixed.

By the way if we talk about why this error happening. It's because of in the latest version of react-native-tab-view TabHeader components are inheriting from TouchableFeedback and setting accessibilityRole as "tab" but none valid role in android native side. So this error happening. I can't go deep in library and fix it cause I don't had time that much currently. If any of contributors from this project tracking this issue. They can easily fix.

Best wishes.

All 16 comments

Hello, same here!
OS: Android
React Native: 0.59.10

Can you provide an example using Snack?

+1

+1 same problem caused by createMaterialTopTabNavigator

same issue. Just came out of nowhere two days ago

Same here. I just added react-native-gesture-handler:1.3.0 react-native-reanimated:1.2.0 and upgrade react-native-tab-view to 2.7.0 and this happen.

What's wrong with React Native? Out of blues, this error starts showing up? :(

It's really strange. It's working on this snack https://snack.expo.io/@jessebrightman/tabs-error but same code is not working on my project. I am verifying dependencies and will report back.

BTW - my project is a bare project. It was working fine until last weekend then Poof this error showed up. I wasn't even working on it.

I hadn't modified my project in a while, and now I just tried to run an "npx react-native run-android" and got this error. The only thing that has changed since then is that the react-native version has been updated. It looks like we're all at 0.59.

any luck on this issue?

no luck yet! but as a temporary solution you can use Tabs from native-base it is the only one working for me!

Hi everyone, I figured out with temporary solution actually. Here what is:

I set react-native-tab-view version 2.7.0 with hardcoded in package.json. Not "^2.7.0", because if you set like this it's downloading 2.13.0 from npm, which had actual problem.

react-native-gesture-handler version 1.3 and react-native-reanimated version 1.2 which re compatible with 2.7.0 because it's latest version before Android X version as this 3rd party libraries. So problem basically fixed.

By the way if we talk about why this error happening. It's because of in the latest version of react-native-tab-view TabHeader components are inheriting from TouchableFeedback and setting accessibilityRole as "tab" but none valid role in android native side. So this error happening. I can't go deep in library and fix it cause I don't had time that much currently. If any of contributors from this project tracking this issue. They can easily fix.

Best wishes.

Thanks @yadigarbz, that's fixed my problem. For beginnner users, remember you must run npm install after change the packages version on package.json.

It's been three weeks since we asked for additional information from the author of this issue. As it happens, we don't have enough information to take action. We are going to close this issue, but please do not hesitate to open a new issue if you are still encountering this problem.

@yadigarbz Thank you! That fixed it for me!

Was this page helpful?
0 / 5 - 0 ratings