Syncing with gradle did not solve the problem for me.
Grant permission to install apps from unknown sources.
Because the debug certificate is created by the build tools and is insecure by design, most app stores including the Google Play Store do not accept apps signed with a debug certificate for publishing.
At the time we started getting this error, we used gradle wrapper 4.