Build error 'Use of bitwise '&' '|' with boolean operands

Hi.
I’m having following errors in building a game project using VRTemplate after building Unreal Engine 5.0.3 from source. Any comments will be helpful.

UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): In file included from C:/UE/Engine/Source/Runtime/Core/Public/Logging/LogCategory.h:7:
[2022.12.18-07.09.42:281][499]UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): C:/UE/Engine/Source/Runtime/Core/Public/UObject/NameTypes.h(545,10): warning: use of bitwise '&' with boolean operands [-Wbitwise-instead-of-logical]
[2022.12.18-07.09.42:281][499]UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):                 return (ComparisonIndex == Ename) & (GetNumber() == 0);
[2022.12.18-07.09.42:281][499]UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[2022.12.18-07.09.42:281][499]UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):                                                   &&
[2022.12.18-07.09.42:281][499]UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): C:/UE/Engine/Source/Runtime/Core/Public/UObject/NameTypes.h(545,10): note: cast one or both operands to int to silence this warning
[2022.12.18-07.09.42:281][499]UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): C:/UE/Engine/Source/Runtime/Core/Public/UObject/NameTypes.h(550,10): warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
[2022.12.18-07.09.42:281][499]UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):                 return (ComparisonIndex != Ename) | (GetNumber() != 0);
[2022.12.18-07.09.42:281][499]UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[2022.12.18-07.09.42:281][499]UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):                                                   ||
[2022.12.18-07.09.42:281][499]UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): C:/UE/Engine/Source/Runtime/Core/Public/UObject/NameTypes.h(550,10): note: cast one or both operands to int to silence this warning
[2022.12.18-07.09.42:281][499]UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): 2 warnings generated.
[2022.12.18-07.09.42:281][499]PackagingResults: Warning: use of bitwise '&' with boolean operands [-Wbitwise-instead-of-logical]
[2022.12.18-07.09.42:281][499]PackagingResults: Warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]

I’ve fixed this error by matching correct version of toolchains such as NDK, Java, Android SDK. Originally it happened when I was building an application project after I rolled back to 5.03 from 5.1 which I built Unreal Engine successfully from source. And I found there were different tool chains between the versions.
It’s gone in UE5.03 with JAVA jdk_1.8.0_311 instead of jdk-18.0.2.1. NDK is r21b with UE5.0.3

hi I am having the same problem with my game when I am packaging it but I am on Mac in unreal 4.26 and a also in 5.1.1 If there is something I have to download could you send me a link

1 Like

same here

1 Like