App can not be opened because it is from an unidentified developer
Broadly speaking, when distributing apps outside the Mac App Store you need to:


Set the signing identity to Developer ID
Create your Developer ID certificates
Create your app Archive
Validate your app
Export a Developer ID signed app
Sign the installer package (not applicable in your case)
Test the app's behaviour with Gatekeeper enabled and again with Gatekeeper disabled


Troubleshooting issues such as this can be tricky because it's easy to make assumptions about how much the OP (in this case you) knows, etc. From reading your question I'm going to assume the first three steps are taken care of. 

So, let's start by double-checking how you're validating your app.

Validate your app

To validate a Developer ID-signed app, follow these steps:


In Xcode go to Product > Archive
The Archives organizer window will appear
Select the archive for the app in question
Click on the Validate button
A dialogue box appears asking you to select a method for validation
Select the Validate a Developer ID-signed Application option
Click on Next
In the next window select a team from the pop-up menu
Click on Choose
Click the Validate button


This will identify any validation issues. If any are found, this will be your problem (or at least part of it), so you will need to resolve this.

If no issues are found, then proceed below.

Export a Developer ID-signed app


Still within the Archives organizer window, select the archive for the app in question
Click on the Export button
A dialogue box appears asking you to select a method for export
Select the Export a Developer ID-signed Application option
Click on Next
In the next window select a team from the pop-up menu
Click on Choose
Click the Export button


Once your app is exported you should test with Gatekeeper enabled and again with Gatekeeper disabled.