No, you have modified the Main module with the #If B4A statement and not the B4XMainPage module.
The Main modules are specific for each platform, and therefore different, and belong to the *.b4a, *.b4j and *.b4i file and these are not shared between the platforms.
These files are located in their specific platform sub folder.
There is no need to modify the Main module and try to write code for more than one platform.
The B4XMainPage module is a common file, B4XMainPage.bas, for all three platforms and is located in the project folder.