Cant compile 1.1.5
menu/menu/android/src/main/java/com/reactnativemenu/MenuViewManager.kt:155:32 Type mismatch: inferred type is Int? but Float was expected
Hi,
I have the same error.
For which version of React Native are you building?
Hi,
I have the same error.
For which version of React Native are you building?
0.75.4
Same error. RN 0.75.4
Task :react-native-menu_menu:compileDebugKotlin e: file:///Users/mac/Dev/dev2/MyApp/node_modules/@react-native-menu/menu/android/src/main/java/com/reactnativemenu/MenuViewManager.kt:155:32 Type mismatch: inferred type is Int? but Float was expected e: file:///Users/mac/Dev/dev2/MyApp/node_modules/@react-native-menu/menu/android/src/main/java/com/reactnativemenu/MenuViewManager.kt:155:32 No value passed for parameter 'p2'
Task :react-native-menu_menu:compileDebugKotlin FAILED
Same issue here, using React Native 0.74.5 on the project.
You can either solve it with two work arounds: Putting a resolutions on your package.json so the react-native-menu version will stick to the 1.1.4, like this:
"resolutions": {
"@react-native-menu/menu": "1.1.4"
},
or even go to the file that is generating the error (MenuViewManager.kt) and override the function to utilize the code from the previous version, so it will stay like this:
fun setBorderColor(view: ReactViewGroup, index: Int, color: Int?) {
val rgbComponent = if (color == null) YogaConstants.UNDEFINED else (color and 0x00FFFFFF).toFloat()
val alphaComponent = if (color == null) YogaConstants.UNDEFINED else (color ushr 24).toFloat()
view.setBorderColor(SPACING_TYPES[index], rgbComponent, alphaComponent)
}
Same here, downgrading to 1.1.4 works for me.
0.74.5 with new arch enabled
This issue originated from my previous PR https://github.com/react-native-menu/menu/pull/941, which aimed to update the codebase for React Native 0.76 compatibility. I've now created another PR (#948) to restore backward compatibility with earlier versions. This should help.
I tried updating from version 0.75.4 to 0.76.0, and it's giving an error. Does anyone know if it's working with the new RN update to 0.76.0?
I tried updating from version 0.75.4 to 0.76.0, and it's giving an error. Does anyone know if it's working with the new RN update to 0.76.0?
It should work. Make sure you're using version 1.1.5, which includes the necessary signature changes for ReactViewGroup.setBorderColor() introduced in React Native 0.76.
should be fixed in 1.1.6
No problem. I've upgraded RN version to 0.76. Now no errors. Thank you.
Same issue here, using React Native 0.74.5 on the project.
You can either solve it with two work arounds: Putting a resolutions on your package.json so the react-native-menu version will stick to the 1.1.4, like this:
"resolutions": { "@react-native-menu/menu": "1.1.4" },or even go to the file that is generating the error (MenuViewManager.kt) and override the function to utilize the code from the previous version, so it will stay like this:
fun setBorderColor(view: ReactViewGroup, index: Int, color: Int?) { val rgbComponent = if (color == null) YogaConstants.UNDEFINED else (color and 0x00FFFFFF).toFloat() val alphaComponent = if (color == null) YogaConstants.UNDEFINED else (color ushr 24).toFloat() view.setBorderColor(SPACING_TYPES[index], rgbComponent, alphaComponent) }
thanks, this work for me