Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24447] iOS: 6.0.2.GA iOS Store Builds Missing beta-reports-active

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionDuplicate
Resolution Date2017-03-06T15:50:44.000+0000
Affected Version/sRelease 6.0.2
Fix Version/sRelease 6.0.3
ComponentsiOS
Labelsbeta-testing, distribution, ios
ReporterDawson Toth
AssigneeChris Barber
Created2017-03-02T01:44:44.000+0000
Updated2017-03-07T17:39:07.000+0000

Description

If I package my iOS app for store distribution and upload to iTunesConnect, the "beta-reports-active" entitlement is missing if I use 6.0.2.GA. Using 6.0.1.GA with the same app, same provisioning profile, same commands, only difference is the SDK, the entitlement is included properly.

Comments

  1. Chris Barber 2017-03-02

    Whoops. OK, I fix. :)
  2. Chris Barber 2017-03-02

    I can't reproduce this. :( I tested with Titanium SDK 6.0.1.GA, 6.0.2.GA, and master (6.1.0) and built using Xcode 8.2 + iOS 10.2 and Xcode 8.3 beta 2 + iOS 10.3. All of them had the beta-reports-active entry in the entitlements file. I even uploaded it to the app store without issue. Maybe you need to do a clean build? I looked at the code and it looks pretty straight forward:
       if (this.target === 'dist-appstore' && !plist.hasOwnProperty('beta-reports-active')) {
           plist['beta-reports-active'] = true;
       }
       
    It's possible to have a custom platform/ios/entitlements.plist file with a <beta-reports-active> containing an invalid value such as nothing or some value other than true or false. I can see that causing an issue. On a side note, you can now put custom entitlements in the <ios><entitlements><plist> section of the tiapp.xml that override the custom entitlements plist.
  3. Dawson Toth 2017-03-06

    Hmm, the target might be the difference -- I target dist-adhoc (with my store cert and profile) so that I can --output-dir the IPA to a specific place, and then I [fastlane](https://github.com/fastlane/fastlane) it directly to iTunesConnect. Did something change recently there? Looking at the IPA, I see now that it's being signed with a different provisioning profile than what I specified. I'm guessing that because I specified dist-adhoc, the tooling decided that I really meant that my adhoc profile should be used, instead of my store distribution profile? My build is essentially:
       appc ti build\
        	--sdk=${sdk:-$sdkIOS}\
       	--no-banner\
       	--no-prompt\
       	--platform=ios\
       	--device-family="universal"\
       	--deploy-type="production"\
       	--distribution-name="$ios_distribution_name"\
       	--pp-uuid="$ios_distribution_uuid"\
       	--target="dist-adhoc"\
       	--output-dir=build\
       	--skip-js-minify
       
    I deleted the adhoc provisioning profile from my computer, and tried to build again, and got the following error:
       [ERROR] Failed to export archive to ipa
       [ERROR] 2017-03-05 23:07:58.948 xcodebuild[6997:134614] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/gb/bn5tvy2s2vqcf6hxs9qz17tm0000gn/T/Housters_2017-03-05_23-07-58.947.xcdistributionlogs'.
       [ERROR] 1.2.840.113635.100.1.61
       [ERROR] 2017-03-05 23:07:59.090 xcodebuild[6997:134614] [MT] IDEDistribution: -[IDEDistributionProvisioning _itemToSigningInfoMap:]: Can't find any applicable signing identities for items: (
       [ERROR]     "<IDEDistributionItem: 0x7faac1fe7100 'com.tothsolutions.housters' '<DVTFilePath:0x7faac311a340:'/Users/dtoth/Code/houstersMobile/build/iphone/Housters.xcarchive/Products/Applications/Housters.app'>'>"
       [ERROR] ) 
       [ERROR] Errors={
       [ERROR]     "<DVTSigningCertificate: 0x7faac1dbdaa0; name='iPhone Distribution: Housters, LLC. (X95YL24UT4)', ..., certificateKind='1.2.840.113635.100.6.1.4, issueDate='2017-02-22 01:29:19 +0000''>" =     {
       [ERROR]         "<IDEDistributionItem: 0x7faac1fe7100 'com.tothsolutions.housters' '<DVTFilePath:0x7faac311a340:'/Users/dtoth/Code/houstersMobile/build/iphone/Housters.xcarchive/Products/Applications/Housters.app'>'>" = "Error Domain=IDECodesignResolverErrorDomain Code=10 \"No matching provisioning profiles found\" UserInfo={NSLocalizedRecoverySuggestion=No valid 'ad-hoc' profiles were found., NSLocalizedDescription=No matching provisioning profiles found, IDECodesignResolverError_ResolutionInputsKey=<IDECodesignResolutionInputs: 0x7faac1ff4520; portalTeamID='X95YL24UT4', usingTeamBasedSigning='NO', bundleIdentifier='com.tothsolutions.housters', targetName='(null)', provisioningProfilePurpose='2', requiresProvisioningProfile='YES', provisioningProfilePlatform='iOS', certificateKind='1.2.840.113635.100.6.1.4', requiredEntitlements='{\n    \"application-identifier\" = \"X95YL24UT4.com.tothsolutions.housters\";\n    \"get-task-allow\" = 0;\n    \"keychain-access-groups\" =     (\n        \"X95YL24UT4.com.tothsolutions.housters\"\n    );\n}', requiredCodesignableDevices='(null)', requiredFeatures='(null)'>\n}";
       [ERROR]     };
       [ERROR] } 
       [ERROR] 2017-03-05 23:07:59.091 xcodebuild[6997:134614] [MT] IDEDistribution: Step failed: <IDEDistributionSigningAssetsStep: 0x7faac3123bf0>: Error Domain=IDEDistributionErrorDomain Code=3 "(null)" UserInfo={IDEDistributionErrorSigningIdentityToItemToUnderlyingErrorKey={
       [ERROR]     "<DVTSigningCertificate: 0x7faac1dbdaa0; name='iPhone Distribution: Housters, LLC. (X95YL24UT4)', ..., certificateKind='1.2.840.113635.100.6.1.4, issueDate='2017-02-22 01:29:19 +0000''>" =     {
       [ERROR]         "<IDEDistributionItem: 0x7faac1fe7100 'com.tothsolutions.housters' '<DVTFilePath:0x7faac311a340:'/Users/dtoth/Code/houstersMobile/build/iphone/Housters.xcarchive/Products/Applications/Housters.app'>'>" = "Error Domain=IDECodesignResolverErrorDomain Code=10 \"No matching provisioning profiles found\" UserInfo={NSLocalizedRecoverySuggestion=No valid 'ad-hoc' profiles were found., NSLocalizedDescription=No matching provisioning profiles found, IDECodesignResolverError_ResolutionInputsKey=<IDECodesignResolutionInputs: 0x7faac1ff4520; portalTeamID='X95YL24UT4', usingTeamBasedSigning='NO', bundleIdentifier='com.tothsolutions.housters', targetName='(null)', provisioningProfilePurpose='2', requiresProvisioningProfile='YES', provisioningProfilePlatform='iOS', certificateKind='1.2.840.113635.100.6.1.4', requiredEntitlements='{\n    \"application-identifier\" = \"X95YL24UT4.com.tothsolutions.housters\";\n    \"get-task-allow\" = 0;\n    \"keychain-access-groups\" =     (\n        \"X95YL24UT4.com.tothsolutions.housters\"\n    );\n}', requiredCodesignableDevices='(null)', requiredFeatures='(null)'>\n}";
       [ERROR]     };
       [ERROR] }}
       [ERROR] error: exportArchive: The operation couldn’t be completed. (IDEDistributionErrorDomain error 3.)
       [ERROR]   
       [ERROR] Error Domain=IDEDistributionErrorDomain Code=3 "(null)" UserInfo={IDEDistributionErrorSigningIdentityToItemToUnderlyingErrorKey={
       [ERROR]     "<DVTSigningCertificate: 0x7faac1dbdaa0; name='iPhone Distribution: Housters, LLC. (X95YL24UT4)', ..., certificateKind='1.2.840.113635.100.6.1.4, issueDate='2017-02-22 01:29:19 +0000''>" =     {
       [ERROR]         "<IDEDistributionItem: 0x7faac1fe7100 'com.tothsolutions.housters' '<DVTFilePath:0x7faac311a340:'/Users/dtoth/Code/houstersMobile/build/iphone/Housters.xcarchive/Products/Applications/Housters.app'>'>" = "Error Domain=IDECodesignResolverErrorDomain Code=10 \"No matching provisioning profiles found\" UserInfo={NSLocalizedRecoverySuggestion=No valid 'ad-hoc' profiles were found., NSLocalizedDescription=No matching provisioning profiles found, IDECodesignResolverError_ResolutionInputsKey=<IDECodesignResolutionInputs: 0x7faac1ff4520; portalTeamID='X95YL24UT4', usingTeamBasedSigning='NO', bundleIdentifier='com.tothsolutions.housters', targetName='(null)', provisioningProfilePurpose='2', requiresProvisioningProfile='YES', provisioningProfilePlatform='iOS', certificateKind='1.2.840.113635.100.6.1.4', requiredEntitlements='{\n    \"application-identifier\" = \"X95YL24UT4.com.tothsolutions.housters\";\n    \"get-task-allow\" = 0;\n    \"keychain-access-groups\" =     (\n        \"X95YL24UT4.com.tothsolutions.housters\"\n    );\n}', requiredCodesignableDevices='(null)', requiredFeatures='(null)'>\n}";
       [ERROR]     };
       [ERROR] }}
       
    I then switched back to 6.0.1.GA, cleaned, and built again with the same command line, and it signed properly with the profile I specified...
  4. Chris Barber 2017-03-06

    Meet TIMOB-24444. Titanium SDK 6.0.1.GA introduced support for Xcode 8.3 beta. Xcode 8.3 has completely removed the PackageApplication command line tool that we used. In order to generate the .ipa file, we call xcodebuild with various export archive options to generate the .ipa file. Turns out that xcodebuild is very picky about which provisioning profile you use. If you use an app store or development provisioning profile for a dist-adhoc build, it will blow up. We would love to validate the provisioning profile prior to building, but we simply don't know much about the provisioning profile aside from the vague info in the <plist> section of provisioning profile. There's a ton of binary data in the provisioning profile and I'm guessing it will tell you if it's an app store, ad hoc, or enterprise ad hoc provisioning profile.
  5. Dawson Toth 2017-03-06

    Makes perfect sense, then. Is there a way to make dist-appstore output to a particular directory, instead of opening the archives tab of Xcode? Or is that out of the CLI's hands?
  6. Chris Barber 2017-03-06

    Without hacks, no. :( With hacks, yes! The easiest is to edit https://github.com/appcelerator/titanium_mobile/blob/master/iphone/cli/hooks/package.js#L132 and just comment out whatever you want. The hard way is to write a hook that removes the package.js's build.post.compile hook during build.pre.compile and adds a new build.post.compile that does exactly what you want. Note that you would have to hijack either the dist-appstore or dist-adhoc target.
  7. Dawson Toth 2017-03-06

    Thanks Chris! You can close this if you want -- no action required. It makes sense to me what happened now.
  8. Dawson Toth 2017-03-06

    PS: <3 miss you :)
  9. Chris Barber 2017-03-06

    Resolving as sort of dupe of TIMOB-24444. PS: Aw, I'm blushing. :)
  10. Abir Mukherjee 2017-03-07

    Verified that issue is being addressed in TIMOB-24444. Closing.

JSON Source