Cannot distribute inhouse build with ios-charts library embedded to my project - ios

first of all, I would like to thank you for creating this library. I have embedded it in my project (as written in the README file) by dragging it into the project, embedding it in the binaries and so on. Target iOS version is 8.0.
Everything worked great for dev version of the app, but as soon as I built the inhouse version, app crashes after initial welcome screen shows. Logs for the crash are as following:
Oct 20 15:54:15 iPhone SpringBoard[54] <Error>: SecTrustEvaluate [leaf IssuerCommonName SubjectCommonName]
Oct 20 15:54:15 iPhone SpringBoard[54] <Error>: SecTrustEvaluate [leaf IssuerCommonName SubjectCommonName]
Oct 20 15:54:15 iPhone kernel[0] <Notice>: xpcproxy[700] Container: /private/var/mobile/Containers/Data/Application/6D451583-EE0E-4F0A-9CA9-2E33F83D6138 (sandbox)
Oct 20 15:54:15 iPhone kernel[0] <Notice>: AMFI: energy_challenge(pid 700) - [deny-mmap] mapped executable file has no team identifier in its signature: /private/var/mobile/Containers/Bundle/Application/84AEA7F2-4987-4119-B3CC-A4EAFC9989DC/energy_challenge.app/Frameworks/Charts.framework/Charts
Oct 20 15:54:15 iPhone com.apple.xpc.launchd[1] (UIKitApplication:com.edge5.nativeMenuEnergieInhouse[0x1f2e][700]) <Notice>: Service exited due to signal: Trace/BPT trap: 5
Oct 20 15:54:15 iPhone assertiond[63] <Warning>: Unable to obtain a task name port right for pid 700: (os/kern) failure (5)
Oct 20 15:54:15 iPhone SpringBoard[54] <Warning>: Unable to register for exec notifications: No such process
Oct 20 15:54:15 iPhone SpringBoard[54] <Warning>: Unable to obtain a task name port right for pid 700: (os/kern) failure (5)
Oct 20 15:54:15 iPhone SpringBoard[54] <Warning>: Unable to obtain a task name port right for <FBApplicationProcess: 0x13226dc00; com.edge5.nativeMenuEnergieInhouse; pid: 700>
Oct 20 15:54:15 iPhone SpringBoard[54] <Warning>: Application 'UIKitApplication:com.edge5.nativeMenuEnergieInhouse[0x1f2e]' crashed.
Oct 20 15:54:15 iPhone SpringBoard[54] <Warning>: Application '(null)' exited for an unknown reason.
Oct 20 15:54:15 iPhone ReportCrash[701] <Notice>: Formulating report for corpse[700] energy_challenge
Oct 20 15:54:15 iPhone ReportCrash[701] <Warning>: report not saved because the limit of 25 for 109_energy_challenge logs has been reached.
Oct 20 15:54:15 iPhone ReportCrash[701] <Error>: Notice: This report is abbreviated for syslog inclusion because it could not be saved to disk.
Symbolication may be possible by manually cleaning up and including the Binary Image section of a full report from this same device -- good luck!
Oct 20 15:54:15 iPhone ReportCrash[701] <Error>: Process: energy_challenge [700]
Path: /private/var/mobile/Containers/Bundle/Application/84AEA7F2-4987-4119-B3CC-A4EAFC9989DC/energy_challenge.app/energy_challenge
OS Version: iOS 9.0.2 (13A452)
Oct 20 15:54:15 iPhone ReportCrash[701] <Error>: Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x0000000120095088
Triggered by Thread: 0
Oct 20 15:54:15 iPhone ReportCrash[701] <Error>: Dyld Error Message:
Dyld Message: Library not loaded: #rpath/Charts.framework/Charts
Referenced from: /var/mobile/Containers/Bundle/Application/84AEA7F2-4987-4119-B3CC-A4EAFC9989DC/energy_challenge.app/energy_challenge
Reason: no suitable image found. Did find:
/private/var/mobile/Containers/Bundle/Application/84AEA7F2-4987-4119-B3CC-A4EAFC9989DC/energy_challenge.app/Frameworks/Charts.framework/Charts: mmap() errno=1 validating first page of '/private/var/mobile/Containers/Bundle/Application/84AEA7F2-4987-4119-B3CC-A4EAFC9989DC/energy_challenge.app/Frameworks/Charts.framework/Charts'
Dyld Version: 369.12
Oct 20 15:54:16 iPhone wifid[39] <Error>: WiFi:[467042056.241745]: Enable WoW requested by "apsd"
Oct 20 15:54:16 iPhone wifid[39] <Error>: WiFi:[467042056.243839]: Unable to dispatch WowStateChanged message to client dataaccessd (268435460)
Oct 20 15:54:16 iPhone wifid[39] <Error>: WiFi:[467042056.244041]: Unable to dispatch WowStateChanged message to client MobileMail (268435460)
Oct 20 15:54:16 iPhone wifid[39] <Error>: WiFi:[467042056.244185]: Unable to dispatch WowStateChanged message to client softwareupdatese (268435460)
Oct 20 15:54:16 iPhone wifid[39] <Error>: WiFi:[467042056.244422]: Unable to dispatch WowStateChanged message to client dataaccessd (268435460)
Oct 20 15:54:16 iPhone wifid[39] <Error>: WiFi:[467042056.244678]: Unable to dispatch WowStateChanged message to client assistantd (268435460)
Oct 20 15:54:16 iPhone wifid[39] <Error>: WiFi:[467042056.245010]: Unable to dispatch WowStateChanged message to client itunesstored (268435460)
The problem occurs here:
[deny-mmap] mapped executable file has no team identifier in its signature: /private/var/mobile/Containers/Bundle/Application/84AEA7F2-4987-4119-B3CC-A4EAFC9989DC/energy_challenge.app/Frameworks/Charts.framework/Charts
I tried creating new certificate, new inhouse build, basically went through all the stackoverflow questions regarding this or similar issue (eg. https://www.airsignapp.com/ios-apps-using-swift-crash-when-signed-with-inhouse-certificate/) without any success. Is it possible that maybe you need to change something certificate-related on your side?
Thank you very much for any answer

I came across this post when I was searching for "[deny-mmap] mapped executable file has no team identifier in its signature" on Google.
It turned out that the old Apple WWDR Cert expired on 14 Feb 2016. If your OSX still has that expired cert in Keychain Access, your Distribution Certificate would be regarded as invalid. (A red line showing "This certificate has an invalid issuer") You could forcefully "trust" that cert in Keychain Access, but the side effect is that the signed binary would NOT have TeamIdentifier in its signature:
$ codesign -d -vv MyApp.app
Executable=/Users/admin/MyApp.app/MyApp
Identifier=info.eddywong.MyApp
Format=bundle with Mach-O universal (armv7 arm64)
CodeDirectory v=20100 size=1920 flags=0x0(none) hashes=87+5 location=embedded
Signature size=4389
Authority=iPhone Distribution: Eddy Wong Limited (KG7UETNRCJ)
Authority=Apple Worldwide Developer Relations Certification Authority
Authority=Apple Root CA
Signed Time=15 Mar 2016 23:59:38
Info.plist entries=33
TeamIdentifier=not set
Sealed Resources version=2 rules=12 files=108
So I had to follow the solution posted in https://stackoverflow.com/a/35400712 - to remove the old, expired WWDR certificate in "System" keychain.
Then, I cleaned and re-archive, then export IPA. This time it works!
The reason why "Everything worked great for dev version of the app" is that dev version of the app is signed by your own developer cert, not your organization's distribution cert. I can't figure out why developer cert is not affected by WWDR expiry, though. But I could verify that the dev signed binary does have the TeamIdentifier set, while the dist signed binary doesn't.

Related

iOS MDM enrollment fails in iOS 9 devices

This has been previously working for iOS 7 and 8 devices but now the enrollment fails for new iOS 9 devices. This is what I see in the device logs.
Oct 26 18:00:34 iPhone profiled[412] <Notice>: (Note ) MC: Enrolling in OTA Profile service...
Oct 26 18:00:35 iPhone profiled[412] <Error>: SecTrustEvaluate [leaf AnchorTrusted]
Oct 26 18:00:38 iPhone securityd[83] <Error>: securityd_xpc_dictionary_handler profiled[412] add Error Domain=NSOSStatusErrorDomain Code=-25299 "duplicate item O,cert,159EFDE0,L,dku,com.apple.certificates,0,ctyp,cenc,labl,subj,issr,slnr,pkhh,v_Data,20151026123038.608026Z,7C914284" UserInfo={NSDescription=duplicate item O,cert,159EFDE0,L,dku,com.apple.certificates,0,ctyp,cenc,labl,subj,issr,slnr,pkhh,v_Data,20151026123038.608026Z,7C914284}
Oct 26 18:00:38 iPhone profiled[412] <Error>: SecOSStatusWith error:[-25299] Error Domain=NSOSStatusErrorDomain Code=-25299 "duplicate item O,cert,159EFDE0,L,dku,com.apple.certificates,0,ctyp,cenc,labl,subj,issr,slnr,pkhh,v_Data,20151026123038.608026Z,7C914284" UserInfo={NSDescription=duplicate item O,cert,159EFDE0,L,dku,com.apple.certificates,0,ctyp,cenc,labl,subj,issr,slnr,pkhh,v_Data,20151026123038.608026Z,7C914284}
Oct 26 18:00:38 iPhone profiled[412] <Error>: SecTrustEvaluate [leaf AnchorTrusted]
Oct 26 18:00:38 iPhone profiled[412] <Notice>: (Note ) MC: Attempting to retrieve issued certificate...
Oct 26 18:00:39 iPhone securityd[83] <Error>: SecDbRecordChange db <SecDbConnection rw open> changed outside txn
Oct 26 18:00:39 iPhone profiled[412] <Notice>: (Note ) MC: Issued certificate received.
Oct 26 18:00:39 iPhone Preferences[406] <Notice>: (Error) MC: Install profile data, interactive error. Error: NSError:
Desc : Couldn’t communicate with a helper application.
Sugg : Try your operation again. If that fails, quit and relaunch the application and try again.
Domain : NSCocoaErrorDomain
Code : 4097
Extra info:
{
NSDebugDescription = "connection to service named com.apple.managedconfiguration.profiled";
}
Oct 26 18:00:39 iPhone com.apple.xpc.launchd[1] (com.apple.managedconfiguration.profiled[412]) <Notice>: Service exited due to signal: Trace/BPT trap: 5
Oct 26 18:00:40 iPhone ReportCrash[423] <Error>: assertion failed: 13A452: libsystem_trace.dylib + 15931 [45DE3123-E22D-320F-9F75-1CCD65A33451]: 0x0
Oct 26 18:00:40 iPhone Unknown[423] <Error>:
Oct 26 18:00:40 iPhone ReportCrash[423] <Warning>: os_activity_diagnostic_for_pid() failed!
Oct 26 18:00:40 iPhone ReportCrash[423] <Notice>: Formulating report for corpse[412] profiled
assertion failed: 13A452: libsystem_trace.dylib + 15931
means that your process "profiled" overran its allocated memory and was killed via the kernel/jetsam. iOS 9 has aggressive memory management and kills processes all over the place and even reboots the device nightly.
Just answering my own question. In order to create the X509 certificate from csr you need to create relative distinguished names (RDNs) and add it to the certificate. Once you get the X500Name from PKCS10CertificationRequest and set it to X509v3CertificateBuilder it throws this error. Rather you have to create separate X500Names and proceed with the certificate generation which solved this issue.

iOS 9 enterprise app verify failed

Apple change the way enterprise app verified on iOS 9, but when I verify our app in "Settings - General - Profiles", I got this
I've check the log:
Oct 15 21:32:21 Nix-iPhone online-auth-agent[216] <Error>: Caller does not have required entitlement 'com.apple.private.mis.trust.set'
Oct 15 21:32:21 Nix-iPhone online-auth-agent[216] <Error>: SecTrustEvaluate [leaf AnchorTrusted]
Oct 15 21:32:31 Nix-iPhone online-auth-agent[216] <Notice>: Server returned no data
Oct 15 21:32:31 Nix-iPhone online-auth-agent[216] <Notice>: Could not complete online authentication
Oct 15 21:32:31 Nix-iPhone online-auth-agent[216] <Warning>: session error: The request timed out.
Oct 15 21:32:31 Nix-iPhone Preferences[223] <Warning>: Failed to verify provisioning profile d43b2b57-8def-4c46-88c9-fc57503890ad with error 32
Oct 15 21:32:31 Nix-iPhone Preferences[223] <Error>: SecTrustEvaluate [leaf IssuerCommonName SubjectCommonName]
Oct 15 21:32:31 Nix-iPhone Preferences[223] <Notice>: Authorization is pending.
Oct 15 21:32:31 Nix-iPhone Preferences[223] <Error>: SecTrustEvaluate [leaf IssuerCommonName SubjectCommonName]
Oct 15 21:32:31 Nix-iPhone Preferences[223] <Notice>: Authorization is pending.
Dose anyone know the reason and how to fix this?
Also tried VPN cause I'm in China, but did not work...
I found this link: https://support.apple.com/en-us/HT204460 at the bottom mentioned that it connects to this site https://ppq.apple.com but this site has an invalid certificate which makes the verifying of app fails.
I'll bet apple will fix this right away.
We are experiencing the same issue. I believe it is due to the Apple verification server.
I guess the only thing we can do now, is to WAIT until they fix it.

After installing <Error>: entitlement 'application-identifier' has value not permitted by a provisioning profile

I have an ipa file which I have build using xcodebuild (cmd tools), and successfully install on and can see it on my iPad. When I launch it, it just sits with a blank screen and I can see in the console(Xcode)
: entitlement 'application-identifier' has value not permitted
by a provisioning profile)
I have verified using codesign tools and all the values are correct on the ipa file,
I am using a single target to create multiple apps from different settings and assets.
I resign my app at xcrun as I have to copy the assets after the build process. to my understanding while working on this project if I had wrong values, provisioning profile or certificate combination I shouldn't have gotten an .ipa that would even get installed on the device.
What looks to be that the .ipa associate a different provisioning profile on the device than what it was build with.
I am a ruby developer so xCode and iOs development is new to me, any help would be appreciated
Jul 30 16:21:36 Mannies-Dev-iPad amfid[996] <Error>: Jul 30 16:21:36 SecTrustEvaluate [leaf CriticalExtensions IssuerCommonName]
Jul 30 16:21:37 Mannies-Dev-iPad amfid[996] <Error>: entitlement 'application-identifier' has value not permitted by a provisioning profile
Jul 30 16:21:37 Mannies-Dev-iPad amfid[996] <Error>: entitlement 'application-identifier' has value not permitted by a provisioning profile
Jul 30 16:21:37 Mannies-Dev-iPad amfid[996] <Error>: entitlement 'application-identifier' has value not permitted by a provisioning profile
Jul 30 16:21:37 Mannies-Dev-iPad xxx[995] <Error>: objc[995]: Class WebView is implemented in both /System/Library/PrivateFrameworks/WebKit.framework/WebKit and /var/mobile/Applications/55025FD7-6F95-4D1B-A98F-766D2638C0BD/xxx.app/xxx. One of the two will be used. Which one is undefined.
Jul 30 16:21:38 Mannies-Dev-iPad kernel[0] <Debug>: launchd[995] Builtin profile: container (sandbox)
Jul 30 16:21:38 Mannies-Dev-iPad kernel[0] <Debug>: launchd[995] Container: /private/var/mobile/Applications/55025FD7-6F95-4D1B-A98F-766D2638C0BD (sandbox)
Jul 30 16:21:39 Mannies-Dev-iPad itunesstored[71] <Error>: libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system version dictionary
Jul 30 16:21:39 Mannies-Dev-iPad itunesstored[71] <Error>: libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system version dictionary
Jul 30 16:21:40 Mannies-Dev-iPad itunesstored[71] <Error>: libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system version dictionary
Jul 30 16:21:41 Mannies-Dev-iPad profiled[981] <Notice>: (Note ) profiled: Idled.
Jul 30 16:21:41 Mannies-Dev-iPad profiled[981] <Notice>: (Note ) profiled: Service stopping.

Ad hoc OTA deployment working on all ipads except iPad 3 with IOS 6

I am running into a weird issue for my Company. I have setup a build for my ipad app that is built with an AD hoc profile. I followed all the directions on how to set this up and is working correctly with the provision profile and the app for 5 other ipads. What i have noticed is that for some reason its not working on iPad 3 with IOS6. Here is the error i get in the console when trying:
Oct 31 12:00:56 Scotts-iPad SpringBoard[66] <Warning>: could not save thumbnail for downloading icon: image=(null) path='/var/mobile/Library/SpringBoard/DownloadingIconImageCache/com.localbix.online.ipad-9885BA22-13CA-4388-96A0-08EDCABF459E'
Oct 31 12:00:56 Scotts-iPad SpringBoard[66] <Warning>: could not save thumbnail for downloading icon: image=(null) path='/var/mobile/Library/SpringBoard/DownloadingIconImageCache/com.localbix.online.ipad-5C37022E-5875-4C48-A135-03ADD4AA75B8'
Oct 31 12:00:56 Scotts-iPad installd[30] <Error>: 0x343000 handle_install: Install of "/var/mobile/Media/Downloads/8020495531107338408/6723207522652074632" requested by itunesstored
Oct 31 12:00:56 Scotts-iPad installd[30] <Error>: 0x343000 extract_package: Could not extract archive
Oct 31 12:00:56 Scotts-iPad installd[30] <Error>: 0x343000 stage_package: Could not extract /var/mobile/Media/Downloads/8020495531107338408/6723207522652074632 to /var/tmp/install_staging.oIwDCd/foo_extracted
Oct 31 12:00:56 Scotts-iPad installd[30] <Error>: 0x343000 MobileInstallationInstall_Server: Could not stage the package
Oct 31 12:00:56 Scotts-iPad itunesstored[64] <Error>: 0x1c65000 MobileInstallationInstall: failed with -1
Oct 31 12:00:56 Scotts-iPad installd[30] <Error>: 0x343000 handle_install: API failed
Oct 31 12:01:05 Scotts-iPad profiled[4231] <Notice>: (Note ) profiled: Idled.
Oct 31 12:01:05 Scotts-iPad profiled[4231] <Notice>: (Note ) profiled: Service stopping.
The cert does have those ipad UUID's listed so its not that issue. I have ran out of ideas on what could be the issue. Any ideas? I have talked to a few others and said they have noticed the issue on the latest ipads also but have no idea. Any one else running into this issue?
Much Appreciated!
I figured the answer out. It was as simple as my wifi setup on my ipad had our corporate proxy server defined. Because of this websense was blocking downloading of .ipa file. So if i took that same URL and put it on a desktop browser i could see it was getting blocked. Switching off the proxy fixed the issue!
I had something similar, though no VPN, just a plain Wi-Fi setup.
iPhone4, iPhone5 and iPad2 all running iOS6 can install OTA with no issues.
At the same time, iPhone4S and iPad1 running iOS5 fail to install the app OTA.
Normal installation via iTunes sync works fine for all devices.
It's obviously an issue with OS version, but I have no idea where to look for next.
Is it in the build settings for the app or something related to server config (IIS in this case)...

Simple application crashes

I have developed a simple app that calculates the risk of developing type 2 diabetes. The app runs fine from xcode on my iPhone 3Gs. I archived the app in a .ipa file and I have uploaded the app to my testflightapp.com account. I have installed the app on my iPhone with the standard testflightapp.com procedure: clicking the install link in the email from testflightapp.com.
When I run the app, I see the launch image for a few seconds and then it goes away. The console of my iPhone in xcode displays what is going wrong, but I do not know what this means:
Jan 8 20:00:42 unknown com.apple.launchd[1] <Warning>: (UIKitApplication:com.reinvdo.diabete[0xa6a]) Conflict with job: UIKitApplication:com.reinvdo.diabete[0x291b] over Mach service: com.reinvdo.diabete
Jan 8 20:00:42 unknown com.apple.launchd[1] <Warning>: (UIKitApplication:com.reinvdo.diabete[0xa6a]) Conflict with job: UIKitApplication:com.reinvdo.diabete[0x291b] over Mach service: com.reinvdo.diabete.UIKit.migserver
Jan 8 20:00:42 unknown kernel[0] <Debug>: launchd[4255] Builtin profile: container (sandbox)
Jan 8 20:00:42 unknown kernel[0] <Debug>: launchd[4255] Container: /private/var/mobile/Applications/64A83260-5918-4109-A861-A3399D825654 [69] (sandbox)
Jan 8 20:00:42 unknown com.apple.launchd[1] <Warning>: (UIKitApplication:com.reinvdo.diabete[0x291b]) The following job tried to hijack the service "com.reinvdo.diabete" from this job: UIKitApplication:com.reinvdo.diabete[0xa6a]
Jan 8 20:00:42 unknown UIKitApplication:com.reinvdo.diabete[0xa6a][4255] <Notice>: Couldn't register com.reinvdo.diabete with the bootstrap server. Error: unknown error code.
Jan 8 20:00:42 unknown UIKitApplication:com.reinvdo.diabete[0xa6a][4255] <Notice>: This generally means that another instance of this process was already running or is hung in the debugger.
Jan 8 20:00:43 unknown ReportCrash[4256] <Notice>: Formulating crash report for process diabete[4255]
Jan 8 20:00:43 unknown com.apple.launchd[1] <Warning>: (UIKitApplication:com.reinvdo.diabete[0xa6a]) Job appears to have crashed: Abort trap: 6
Jan 8 20:00:43 unknown SpringBoard[15] <Warning>: Application 'diabete' exited abnormally with signal 6: Abort trap: 6
Jan 8 20:00:43 unknown ReportCrash[4256] <Error>: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/diabete_2012-01-08-200042_reins-iPhone.plist using uid: 0 gid: 0, synthetic_euid: 501 egid: 0
Can anybody shine a light on this error?
On the iPhone, a process of a previous run of the application was still active. To fix the issue, all that is necessary is a reboot.

Resources