When you run codesign on a new certificate for the first time, macOS will prompt you for your admin name/password.
If you select "not allow", you will get the error -1 too, and that's the error you are getting from Delphi also.
Also check:
Apple posted a collection of code signing problems (and some solutions) in a new document: Technical Note TN2407 Code Signing Troubleshooting Index
Check the CODE_SIGN_IDENTITY property in your build settings. Is your provisioning profile selected there?
You also need to enter a valid bundle identifier in your apps .plist.
The identifier has to match the one you provided when generating the profile.
Apple has a technote about that here.
When you use XCode to build a sample, and you get this error, if you right-click the error message in Xcode and choose expand to get more details, do you get a description of the problem? For example, you may have two copies of your developer certificate with the same name in different keychain files, and Xcode couldn't figure out which one to use?
Check if you have any expired certificate on my System keychain. Keychain Access doesn't, by default, show expired certs. You need to go to System keychain, and make KA tell you about expired certificates, then delete the expired one that is colliding with your proper certificate on the login keychain.
5. Check in Keychain Access, if the actual Apple WWDR certificate is marked as "Always Trust". It needs to be "System Defaults". That goes for your Development and Distribution certificates, too. If any of them are incorrectly set to "Always Trust", that can apparently cause this problem.
So, in Keychain Access, click on the Apple Worldwide Developer Relations Certificate Authority certificate, select Get Info. Then, expand the Trust settings, and for the combo box for "When using this certificate:", choose "System Defaults".
Others have commented that you may have to do this in System and login keychains for these errors.
Try adding --deep to Other Code Signing Flags in Build Settings. More information here: Codesign of Dropbox API fails in Xcode 4.6.3: "code object is not signed at all"
In Keychain Access, Check whether you have selected a provisioning profile which includes the valid Code Signing Identity and a valid Bundle Identifier in Settings. (Goto Build Settings->Signing->Provisioning Profile).
Open Keychain Access and click on lock icon at the top left, so it will lock the login keychain and then again click to unlock.
Goto File->Project Settings->Derived Data and delete your project build folder. After that clean and build your app.
8. Check in Keychain Access if your developer certificates were marked as "This certificate was signed by an unknown authority". If you recently upgraded to a newer Mac OS version and have had a couple of other XCode (4.5.2) issues since then, it could be you do not have the WWDR intermediate certificate installed? If yes, I download that from the iOS Provisioning Portal, installed in Keychain Access, try again to deploy the project.