code signing rejected during build leads to invalid certificate after notarization - macos

Code signing fails with a simple rejected during packaging:
Packaging ApplicationWARNING: Code sign failed; please retry manually. Error: Command failed: spctl --assess --type execute --verbose --ignore-cache --no-cache /var/folders/kw/fp514mmd4djdrld7q8_ttp4r0000gr/T/electron-packager/darwin-x64/myapp-darwin-x64/myapp.app
/var/folders/kw/fp514mmd4djdrld7q8_ttp4r0000gr/T/electron-packager/darwin-x64/myapp-darwin-x64/myapp.app: rejected
After notarization, the app crashes with this error:
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGKILL (Code Signature Invalid))
Exception Codes: UNKNOWN_0x32 at 0x0000001e0000a5c0
Exception Codes: 0x0000000000000032, 0x0000001e0000a5c0
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace CODESIGNING, Code 2
These are my packaging options in electron.config.js:
osxSign: {
identity:
'Developer ID Application: ### (###)',
},
osxNotarize: {
appleId: '###',
appleIdPassword: '###',
teamId: '###',
ascProvider: '###',
},
The certificate is listed in Xcode, Keychain Access and in security find-identity -p codesigning -v without warnings and with the related private key attached. I specified it in my config after experiencing the same behavior with the default configuration.
Any ideas what else to try, or what causes the rejection?

The problem was that New provisioning profiles / certificates require notarization to pass spctl checks. So gatekeeperAssess needs to be set to false for spctl. My version of #electron/osx-sign was outdated and did not take that into account. I had to update #electron-forge/* to >=6.0.4

Related

cant start session of Appium server version 1.15.1

This error message is displaying:
An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: 'Command 'F:\\gautam\\android\\platform-tools\\adb.exe -P 5037 -s 192.168.0.115\:5555 shell settings delete global hidden_api_policy_pre_p_apps' exited with code 255'; Stderr: 'Security exception: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS
java.lang.SecurityException: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS
at com.android.providers.settings.SettingsProvider.enforceWritePermission(SettingsProvider.java:1815)
at com.android.providers.settings.SettingsProvider.mutateGlobalSetting(SettingsProvider.java:1023)
at com.android.providers.settings.SettingsProvider.deleteGlobalSetting(SettingsProvider.java:1006)
at com.android.providers.settings.SettingsProvider.delete(SettingsProvider.java:592)
at android.content.ContentProvider$Transport.delete(ContentProvider.java:343)
at com.android.providers.settings.SettingsService$MyShellCommand.deleteForUser(SettingsService.java:406)
at com.android.providers.settings.SettingsService$MyShellCommand.onCommand(SettingsService.java:289)
at android.os.ShellCommand.exec(ShellCommand.java:103)
at com.android.providers.settings.SettingsService.onShellCommand(SettingsService.java:51)
at android.os.Binder.shellCommand(Binder.java:634)
at android.os.Binder.onTransact(Binder.java:532)
at android.os.Binder.execTransact(Binder.java:735)'; Code: '255'`enter code here
An error tells you: Stderr: 'Security exception: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS
Try following steps:
In your phone developer options (Security settings), enable USB Debugging or (or and) Disable permission monitoring. All of these settings are in your dev options.

using security to importing CSSMERR_TP_CERT_EXPIRED secutity codesigning

Does anybody know why when I use 'security' on os x to import a valid identity that it seems to think it has expired:
There are 2 machines, my development machine and a jenkins slave.
I am using the xcodebuild to create an archive and then use:
xcodebuild -exportArchive -archivePath myApp.xcarchive -exportOptionsPlist exportOptions.plist -exportPath . PROVISIONING_PROFILE=fdd0caeb-58fb-41df-a5e8-e5e9bd1f95c9 "OTHER_CODE_SIGN_FLAGS=--keychain /Users/me/Library/Keychains/Buildsystem"
to build an ipa for the store. This works on my development machine using the same archive and the same exportOptions.plist but not on the jenkins slave. I get this error:
016-10-06 23:29:23.438 xcodebuild[87720:8494157] [MT] IDEDistribution:
-[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path
'/var/folders/yd/l_8k4cn91kjc9r853crzz98m0000gn/T/MyApp_2016-10-06_23-29-23.437.xcdistributionlogs'.
2016-10-06 23:29:23.888 xcodebuild[87720:8494157] [MT]
IDEDistribution: Step failed: : Error Domain=IDEDistributionErrorDomain Code=1 "The
operation couldn’t be completed. (IDEDistributionErrorDomain error
1.)"
error: exportArchive: The operation couldn’t be completed.
(IDEDistributionErrorDomain error 1.)
Error Domain=IDEDistributionErrorDomain Code=1 "The operation couldn’t
be completed. (IDEDistributionErrorDomain error 1.)"
** EXPORT FAILED **
I suspect it is because it thinks the code signing identity is bad. When I imported the identity as:
security import AP_Store.p12 -k /Users/me/Library/Keychains/Buildsystem -P ******* -T /usr/bin/codesign
then run:
security find-identity
I get:
1) 71497439A2987BC6830DF2E4879DBD3A5F1B2857 "iPhone Distribution:
xxxxx (xxxxxxxxx)" (CSSMERR_TP_CERT_EXPIRED)
If I import the same identity on my development machine it says it is OK.
Does anybody know why the same identity would be OK on one machine but not another?
This was caused by an expired intermediate certificate.
Apple Worldwide Developer Relations Certification Authority
had expired.
After replacing it everything worked.
A good reference is: MaintainingCertificates
Another thing that can lead to errors such as:
2016-10-11 11:41:11.780 xcodebuild[87463:15799133] [MT]
IDEDistribution: Step failed: : Error Domain=IDEDistributionErrorDomain Code=1
"(null)"
error: exportArchive: The operation couldn’t be completed.
(IDEDistributionErrorDomain error 1.)
is if you have an incorrect team ID in your exportOptions.plist file.

Failed to enable Hyperloop

Using a Pro account, I created a new app (using Studio), when tried to enable Hyperloop, the popup of progress just disappear without any message and still hyperloop disabled.
After checking the Studio logs, I found an error and a suggestion of using the CLI for that.
!ENTRY com.aptana.core 1 0 2016-07-18 20:00:53.309
!MESSAGE (Build 4.7.0.201607130543) [INFO] com.aptana.core/debug/shell/output Process Output:
Failed to enable Hyperloop: Error: TypeError: undefined is not a function
Unable to register the new app with Appcelerator Platform either due to limited connectivity or other unexpected problem. Please retry later using the command 'appc new --import --project-dir /path/to/project' { [Error: ArrowDB apps already exist for this app_guid]
success: false,
description: 'ArrowDB apps already exist for this app_guid',
code: 400,
internalCode: undefined }
When I tried the appc new --import --project-dir ., I got the same message, even removing the app from the platform I can't get hyperloop to work, the other ArrowDB don't seem to have an error (I don't use that personally).
Anything missing?
appc -v = 5.4.0-31
appc ti sdk = 5.4.0.v20160712013704

mobilefirst native ios keychain wrapper issue

I am working on a project for a native iOS app using xcode to develop the project, but including both MobileFirst Platform Foundation capabilities and mobile data capabilities from Bluemix. We are using a shared git repository on IBM DevOps services (jazzhub) to share project source code and work collaboratively on it.
Most of the native apps I have built in the past have been on my own, so this is my first attempt to collaborate using git/xcode working together.
All that is just context for the issue, which is a project using the above environment on my collegues mac build/runs fine. Once I git clone the project and try to run it on my mac I am getting the following error:
*** Assertion failure in -[KeychainItemWrapper writeToKeychain], /tmp/builds/bld-00-20141218-1823-2824648/worklight-ios/framework-xcode-project/NativeSDK-Sources/WorkLight/KeychainItemWrapper.m:311
2015-01-31 13:16:27.657 IBMBankNativeApp[88827:11348297] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Couldn't add the Keychain Item.'
Above this message in the xcode log I see a secussful initialization of the Bluemix and the call to initialize the MFP connection:
2015-01-31 13:16:27.439 NativeApp[88827:11348297] INFO: IBMBluemix initialization successful.
IBMBluemix SDK Version: 1.0.1.20141124-1240
BlueMix Target: https://mybank.mybluemix.net
applicationId: ea36d23f-....
2015-01-31 13:16:27.530 NativeApp[88827:11348297] IBMData SDK initialization successful.
2015-01-31 13:16:27.580 NativeApp[88827:11348297] ViewController - connectToServer - Initializing ...
2015-01-31 13:16:27.591 NativeApp[88827:11348297] [DEBUG] [WL_CONFIG] -[WLConfig init] in WLConfig.m:68 :: {
"application id" = NativeiOSApi;
"application version" = "1.0";
environment = iOSnative;
host = "192.168.0.17";
platformVersion = "6.3.0.00.20141218-1823";
port = 10080;
protocol = http;
wlServerContext = "/MFProject/";
wlUid = "wY/mbnwKTDDYQUvuQCdSgg==";
}
Before the MFP callback for initialization of the connection the application terminates with the keychain error.
I did not add the keychain access to the project, I'm using cocoapods to set-up bluemix support and wonder if that somehow is adding the keychain support?
I tried removing and running, removing then re-adding they keychain support in the project capabilities, all with the same error.
Is there something checked in and replicated by git that shouldn't be?
Thanks in advance!
Verify that the following Key exists under the Root key in both entitlements-debug.plist and entitlements-release.plist:
Key: keychain-access-groups
Type: Array
Inside the above Key:
Key: Item 0
Type: String
Value: $(AppIdentifierPrefix)worklight.group

Unable to run the app on IOS device

I have created a sample titanium project, I am able to run my app on emulator. But when i try to deploy the same device I'm getting the following error,
[ERROR] : Error details: Code Sign error: No codesigning identities found: No codesigning identities (i.e. certificate and private key pairs) that match the provisioning profile specified in your build settings (“Plan India Feedback App”) were found.
[ERROR] : Error details: CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 8.1'
Can any one suggest me what is the issue and how to resolve the same.
Phone version is: 6.1.6
Emulator version: 8.1
It indicates that your app id and Provisioning profiles dont match.Please make them same and you would be good to go
Thanks

Resources