Is there a way in Install4j to expose additional logging output during counter signing? - code-signing

I'm encountering a counter signing error while building an installer
Creating media file 'Multi-File Windows':
Collecting files:
Compiling launchers:
Creating media file:
Signing executable
install4j: compilation failed. Reason: error during counter signing
I'm wondering if there is a way to expose more information on why the counter signing failed.
I tried two different DigiCert Time Stamping services; Verisign and Globalsign. Both returned the same error, so I'm thinking it isn't an issue on their end. But I don't have enough information to figure out what could be going wrong.
This was on Install4j version 5.1.15

You can see the full chains of exceptions if you enable verbose output on the "Build" step.

Related

Codesign issue in framework - Xamarin.mac

I created a framework manually and placed my dynamic libraries in the .framework/Versions/A/lib and info.plist in the .framework/Versions/A/Resources.
However, I get codesigning issue when the files are placed this way -
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Shared.targets(2045,3): error : /usr/bin/codesign exited with code 1
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Shared.targets(2045,3): error : Failed to codesign 'X.app/x.framework/Versions/A/lib/libx.dylib':X.app/x.framework/Versions/A/lib/libx.dylib: replacing existing signature
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Shared.targets(2045,3): error : X.app/x.framework/Versions/A/lib/libx.dylib: No such file or directory
However, if I place the dynamic libraries inside the .framework/Versions/A/Resources, the build succeeds - I add the framework to the Xamarin.Mac project as a Native Reference. This happens only on couple of dynamic libraries and not all (I have nearly 50 dylibs in that folder).
I am not sure why this is an isolated issue on those libraries and why placing it under Resources works.
Also I have disables signing, in .csproj I see <EnableCodeSigning>false</EnableCodeSigning>.
I am pretty new to Xamarin and apple signing, so any tip on what might be wrong or where to start looking will be super helpful. TIA.

Intermittent code signing errors with Xcode 10

Since using Xcode 10 to build our iOS project, I keep seeing an intermittent error appear with my target's extensions.
The first extension is a Today Extension (widget). Every other time I build the project, I see this error:
Embedded binary is not signed with the same certificate as the parent
app. Verify the embedded binary target's code sign settings match the
parent app's
Embedded Binary Signing Certificate: Not Code Signed
Parent App Signing Certificate: - (Ad Hoc Code Signed)
As soon as I build again, the issue goes away, and vice versa. Strangely, if I revert to the Legacy Build System (File>Project Settings...) the issue never appears.
It's also worth mentioning that there aren't issues with running the extensions when it does build.
Does anyone have the same issue or suggestions to work around it?

iOS error "Embedded binary is not signed with the same certificate as the parent app"

Those are my first steps in IOS applications development and I'm facing some problem that I can't figure out.
error: Embedded binary is not signed with the same certificate as the parent app. Verify the embedded binary target's code sign settings match the parent app's.
Embedded Binary Signing Certificate: Not Code Signed
Parent App Signing Certificate: iPhone Developer: Emil Adz (9QNEF95395)
I can't understand, what is a Embedded Binary Signing Certificate?
I went over the questions with the same error here, but none of them were related to the problem presented here (Not Code Signed).
I tried to revoke my certificate from the Apple Developer Member Center and request another certificate, but the issue persists.
Does some know how it could be fixed?
Swift 5 . Simple way in my case check this screen shot i am done
The embedded binary is referring to a widget that you are deploying alongside with your app.
In your case, you are not signing your widget with any Signing Identity (since your error says "Not Code Signed").
To resolve this, go to your Project file, find your widget's target, and under the Build Setting tab, find the Code Signing Identity value. Choose the same code signing identity that you are using for your main app's target.
You will also need to create and configure a provisioning profile specifically for your widget when you want to release it.
Sometimes none of the solution on Stackoverflow works. In that case,
Solution
Make sure that there is no red mark/issue in any of the sections of Signing(Debug), Signing(Release) and Enabled capabilities in both of MainApp and EmbeddedApp
Make sure that both certificates and provisioning profiles are installed under login/system keychain.
Make sure that your certificate is never ever set as Always Trust. Access must be kept as Use System Default
This error is also shown when deployment target of your Today extension is newer than the parent app. They must be the same.
I have iOS app set to 10.0 and added Today extension which was automatically set to 11.4 as the latest. This caused the error to appear. Simply changing the Deployment target of the extension target to 10.0 resolved the issue.
Assumptions
the app I am working is called TestApp (for the sake of privacy)
the steps below are tested in Xcode 11.1
the scheme I was using to compile is AdHoc
the app has the Push Notification capability
Issue
In my case the issue was caused by a discrepancy between the signing of two targets. The issue was between:
the TestApp target (i.e. what in the error is referred to as Parent App Signing Certificate)
the notificationServiceExtension target (i.e. what in the error is referred to as Embedded Binary Signing Certificate).
Resolution
In my AdHoc scheme, under the TestApp target, I disabled the automatic signing because I wanted to specify the provisioning profile and the certificate.
The steps I followed were:
from Signing & Capabilities -> AdHoc -> Signing (section)
removed the tick from Automatically manage signing under selected
selected the provisioning profile I wanted to use
from Build Settings -> Signing (section)
under Code Signing Identity, choose for both AdHoc and Any SDK the certificate I wanted to use
under Code Signing Style -> AdHoc, chose Manual
under Provisioning Profile -> AdHoc, chose the provisioning profile I wanted to use (i.e. the same as step 1.2)
The error was thrown because I didn't apply the same settings to the notificationServiceExtension target (which was still using the automatic signing and therefore another certificate). As soon as I have repeated the steps above also for this target, the error was gone.
I hope it can helps someone, because this error drove me crazy!
It seems this issues appears in xcode 10 and the resolution is different from the aforementioned.
I was able to fix (or rather bypass) the error by setting the Build
System to Legacy (via File > Workspace Settings)
Another interesting thing to note is that the signing error would not
occurr if I was building to an actual device (i.e. before changing the
Build System to Legacy). It would only occurr when building using the
simulator and only on Xcode 10 beta 3, 4 and 5.
Link to the original thread: https://forums.developer.apple.com/thread/105537
I was having this issue when I migrated to Xcode 10 and managed to fix it by updating the architectures in "Build Settings"> "Valid Architectures" for the Watch target to
$(ARCHS_STANDARD)
This thread helped me out a lot: https://forums.developer.apple.com/thread/107563
Oddly enough, I had to remove the products folder from my project in order to fix this error. Xcode crashed then, after reopening, worked like a charm!
I got this error when the App Groups weren't set up correctly on all my App IDs in the Developer Portal. Therefor the App Groups in the app didn't work correctly and the Binary for the extension or the Watchkit app couldn't be signed.
check your Excluded Architectures
I got this error after adding a Copy Files Build Phase to the main app Target.
Copy Files
Destination: Absolute Path
Path: /Applications
File: MyApp.app
This worked the first time I ran the app.
On subsequent runs, Xcode began complaining about the certificate mismatch.
Removing the Copy Files build phase fixes the certificate mismatch. I'm still searching for a way to Copy Files without the error.
Same issue links:
https://stackoverflow.com/a/32802258/1265393
https://forums.developer.apple.com/thread/102707
https://github.com/Bouke/SwiftInitializerGenerator/issues/6
I had the issue when following the SwiftUI documentation about integrating an iOS app with watchOS.
The issue is that the extension is not under the same development team, so it will fail when we try to compile it.
Nothing about architecture and nothing about trust.
SOLUTION:
ScreenShot for xcode
Go to the project general file
Check on the extension folder on the sidebar (check the screenshot number 2)
Switch to the Signing & Capabilities tab
Choose your team (need to match the master project's development team)
I had this problem with a Photo Editing Extension. I eventually discovered that it was due to my unusual project structure.
My project includes a local Swift package containing all the source code and resources for the appex (app extension).
The appex links the library created by the Swift package.
The appex has no source files of its own. The “Compile Sources” build phase has no files, and it has no “Copy Bundle Resources” build phase.
On a clean build, Xcode builds the appex and embeds it in the app successfully.
On an incremental build, even with no changes to any file, Xcode fails during the “Validate MyEx.appex” step.
The problem, it turns out, is that Xcode re-links the appex executable every time it builds, even if nothing has changed. And Xcode does not then sign the new appex executable, except during a clean build.
This means that the appex executable is always unsigned after an incremental build, so it is never signed with the same certificate as the parent app (because the appex isn't signed at all).
My solution was to add an empty file, dummy.swift, to the appex target. That is sufficient to make Xcode only re-link the appex when needed, and to always sign the appex after linking during an incremental build.
I got this error while having another compile time error in my code.
My new target has never been built before.
So I thought I'll fix this error first. But it turned out, that fixing the other error enabled Xcode to build the target and fix the other error itself.
Check if you have more targets like oneSignal or other else and check if you have the same team of the main target.
I was getting this error trying to build a WatchOS app in Xcode 11 - I tried all the various suggestions in this and other SO posts but the thing that finally worked was switching Xcode to use the legacy build system.
Go to: File | Project (or Workspace) Settings | Build System
And select Legacy Build System
XCode 12.5
In my case, I followed Shakeel Ahmed's answer. But I also needed to do this change on the Pod file.
You can find more here https://github.com/facebook/react-native/issues/31480#issue-876308920
I have experienced this same issue in a Unity.iPhone project.
We embed a target for a Stickers extension that we ship with the app.
The Stickers extension target is the one complaining about the code sign settings not matching the parent apps.
error: Embedded binary is not signed with the same certificate as the parent app. Verify the embedded binary target's code sign settings match the parent app's.
Embedded Binary Signing Certificate: Software Signing
Parent App Signing Certificate: Apple Distribution
This occurred when the Stickers Extension target build settings were set to ARCHS_STANDARD (arm7, arm64), while the parent app was set to arm64.
I fixed this by setting the Extension's ARCHS build property to arm64.
Go figure, I suspect this output catches a bunch of different issues and just doesn't specify any details in the log message.
Check your keychain access expire certificate not deleted that's why its showing a error.
In my case the key was to delete 'Products' folder. Then the build was successful. Moreover, after that I made git reset --hard and tried again with the same successful result.

Code signing mismatch error

I am in the process of archiving my app however I have ran into an issue.
Basically I am receiving this error:
error: Embedded binary is not signed with the same certificate as the parent app. Verify the embedded binary target's code sign settings match the parent app's.
I can see that the code signing is indeed mismatched however, I haven't managed to find the location of the 'Embedded Binary Signing Certificate' to fix the issue. Can someone let me know where I can change this?
Thanks.

Mac App Store invalid signature issues

I've recently submitted an application to the Mac App Store and have received an email informing me that the build contains resources (two in total) that carry an invalid signature:
We have discovered one or more issues with your recent binary
submission for "X". Your app has proceeded to review, but the
following issues should be corrected in your next submission:
Invalid Signature - the nested app bundle Y is not
signed, the signature is invalid, or it is not signed with an Apple
submission certificate. Refer to the Code Signing and Application
Sandboxing Guide for more information.
I've read the linked Code Signing and Application Sandboxing Guide but am unfortunately none the wiser as to how I'd go about correctly signing these resources. The first is an executable and the second is a framework. Neither of which I compile manually.
What's the correct way of correctly signing these resources?
You most likely have embedded Frameworks which are not signed. If are using Xcode with sub projects that are Frameworks or have included frameworks which are copied into the application bundle, they must be code signed.
One simple way around this is to use static libraries instead of Frameworks.

Resources