Closed RomaricDel closed 6 years ago
I found the problem. On android I was using a TouchableNativeFeedback element as ref for the popover menu, as follow:
<TouchableNativeFeedback
style={style}
onPress={onPress}
background={TouchableNativeFeedback.SelectableBackground()}
ref={this.setRef}
>
<Icon size={size || 35} name={icon} color={color} />
</TouchableNativeFeedback>
On IOS I have no problem, but i'm using a TouchableOpacity element
<TouchableOpacity
style={style}
onPress={onPress}
ref={this.setRef}
>
<Icon size={size || 35} name={icon} color={color} />
</TouchableOpacity>
If I replace TouchableNativeFeedback by TouchableOpacity on Android the popover works !
So in conclusion TouchableOpacity has a ref compatible with the java ViewGroup class, but ref of a TouchableNativeFeedback is an instance of ReactTextView so cannot be cast to a ViewGroup (see RNPopoverMenuModule.java:69)
For now I will just also use a TouchableOpacity on Android, but I might be nice to find a way of using the popover with TouchableNativeFeedback.
Hi, I'm getting an error while trying to display the menu on android.
com.facebook.react.views.text.ReactTextView cannot be cast to android.view.ViewGroup
I'm running the app on Android 8.0. react-native 0.56.0 react 16.4.1
My build.gradle is
Here is a look at my code
Any leads ?
[EDIT] I also try using sdk 27 in my build.gradle, still not working.