`This app can’t run on your PC` error when launching an electron app

I am a beginner in Electron and working on a small personal project. The user sees a form with a few fields upon opening the app and when he submits the form, the data is appended to an excel sheet within the same directory.

The project is running locally without any issues (no errors or warnings in debugger) and when i build a desktop app using electron-builder --win (i’m on Mac so i have to give –win argument or else it creates an app for Mac), everything goes smoothly too.

But when i try to install/launch the app on a Windows PC, i get the This app can't run on your PC error.

I’ve tried a few online solutions but nothing seems to be working.

Can anyone with electron experience guide me as to what might be going wrong?

I tried to run in administrator mode, disabling anti-virus and then running, and a couple of other supposed solutions but nothing has worked so far.

Error on Launching App