[TIMOB-25318] iOS: Cannot build for devices with 6.2.0.GA
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-09-23T08:12:45.000+0000 |
Affected Version/s | Release 6.2.0 |
Fix Version/s | Release 6.3.0 |
Components | iOS |
Labels | qe-6.2.0 |
Reporter | Eric Wieber |
Assignee | Chris Barber |
Created | 2017-09-19T15:58:47.000+0000 |
Updated | 2017-11-09T23:51:49.000+0000 |
Description
A user is unable to build for device when using 6.2.0.GA. If they switch their SDK to 6.1.2.GA, then the build will succeed. The error they get on build is:
[ERROR] : Error details: Code Signing Error: No profile for team 'S3R5UHXXXX' matching 'AppName' found: Xcode couldn't find any provisioning profiles matching 'S3R5UHXXXX/AppName. Install the profile (by dragging and dropping it onto Xcode's dock item) or select a different one in the General tab of the target editor.
[ERROR] : Error details: Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 11.0'
*I am unable to reproduce this issue, but the steps the user is performing is:*
1. Create a new project
2. Select the 6.2.0.GA SDK
3. Build the project for device
*Expected results:*
The build succeeds without issue
*Actual Results:*
The build fails with the above error
*Notes:*
If ONLY the SDK is changed to 6.1.2.GA, the build succeeds.
The team shown in the error is unknown to the user; their other profiles use a different team.
Did you reproduce it in non-CI builds? There is an open Jenkins issue related to that [here](https://issues.jenkins-ci.org/browse/JENKINS-43675). Btw, I am unable to reproduce with my Alloy test-app [here](https://github.com/hansemannn/studentenfutter-app) using 6.2.0.GA and Xcode 9 GA.
This issue appears to affect users who are a part of multiple teams and who have expired or invalid component combinations between them. We are currently investigating and developing improved ways of prompting for teams/certs/profiles that should prevent this error by better filtering out invalid configurations. Targeting a fix in 6.3.0.GA.
I can confirm the problem. In my case the Team ID is different from the app prefix. At some point Apple give me a new [app prefix](https://db.tt/RslZXTgmFa), but all my existing apps belongs to the old one. So the line 3145 in iphone\cli\commands\_build.js: bs.DEVELOPMENT_TEAM = this.provisioningProfile.appPrefix; generate a non buildable xcode project with the error reported by Eric.
[~c3k] In my tests, removing the DEVELOPMENT_TEAM build setting didn't resolve the problem. In Xcode 9, it appears that the certs are now required to be assigned to the provisioning profile. The DEVELOPMENT_TEAM is set to use the team that is specified in the provisioning profile, so as long as your certs and provisioning profiles are correct, you should be able to build just fine. As a resolution to this ticket, I have enabled code signing for device builds and added validation around provisioning profiles to make sure the selected cert is tied to the provisioning profile.
Ti SDK master PR: https://github.com/appcelerator/titanium_mobile/pull/9462 Ti SDK 6_3_X PR: https://github.com/appcelerator/titanium_mobile/pull/9463 To test, you need to build an iOS app for device, then pick a non-expired provisioning profile that matches the app id, but not the selected developer cert.
Yes, removing the line didn't fix, I had to statically set my Team ID as a workaround. I've tested 6_3_X cli and the problem is fixed, thank you.
Verified in SDK builds 6.3.0.v20170921125635 & 7.0.0.v20170921131230
I'm still having this problem. I'm the one that originally brought this up in a comment on a blog post and Eric reached out to me. I just tested with 6.3.0.v20170921125635 but I'm still having the exact same problem as with 6.2.0 GA. If I switch the SDK to 6.1.2 all the problems go away. I have cleared all my developer certs and provisioning profiles and only left one. I do not have multiple team profiles but it keeps attaching this team id # that is not related to me at all.
[~dlewis23] Double check by running
appc ti info -t ios -o json
and verify theappPrefix
for your provisioning profile. It should match your team id that is associated to your cert and your cert should be listed in the list of the provisioning profile's certs.Thanks [~a.marcone], I linked your ticket to be a duplicate of this one to only have one ticket to focus on. Can you please try out the latest 6.3.0 build as well? Either via CLI (appc ti sdk install -b 6_3_X) or download [here|builds.appcelerator.com].
Chris Barber they are not the same when I run that command I get this. _"appPrefix": "S3Rxxxxxxx"_ and then _"team": [ "QHPxxxxxxxx" ],_ When I build with 6.1.2 GA the Team section in Xcode for provisioning profiles reads as *none* and everything works correctly.
[~dlewis23] That's very interesting. How did you get an
appPrefix
that differs from theteam
? As you may have noticed,team
is an array which could potentially have multiple teams, though I have never seen that, so I don't think we can reliably use the first team in the list. I propose reopening this ticket, then add code that prefers the<team-id>
from the tiapp.xml, but then falls back to theappPrefix
. In your case [~dlewis23], you would simply add<team-id>QHPxxxxxxxx</team-id>
to the<ios>
section of your tiapp. Sound like a plan?tried with 6_3_x and setting a
[~a.marcone] That's because I haven't changed the code yet. My proposal was to honor the
<team-id>
from the tiapp.xml and I'm finishing up something else before I jump back on this ticket.I downloaded the 6.3.0 sdk to test the fix but when trying to build, very early in the process I get an exception as follows:
[~zlitten] Sounds like you are using an old version of Node.js. We recommend Node.js 6.
Chris Barber All of my apps have a different appPrefix then the team ID. I do not have multiple teams. Adding _
[~dlewis23] Correct, I have not change the code yet. Titanium 6.1.x and older does not fully support Xcode 9. As apart of updating Titanium 6.2.x for Xcode 9, we updated the code to added the exact Xcode project build settings that a non-Titanium app would set and this includes
DEVELOPMENT_TEAM
. Apple added stricter validation around provisioning profiles and so we did too. Part of the problem is we don't have a clear way to get which teams you are apart of. The team id is embedded in the provisioning profile, but this has proven to be unreliable and thus we are about to add a manual override. Xcode has you log into your Apple Developer Account via the Preferences window and then caches the teams locally in a SQLite database. We read that SQLite database, but it is unreliable since this cache may be out-of-date or empty if you have yet to set up Xcode. The best solution is also the worst. If we made it so that you could provide your Apple ID and password to the Titanium tooling, then Titanium could log in on your behalf, query the teams, validate/install provisioning profiles, etc. I would love to add this, but not everyone trusts Titanium with their login. Note that the authentication credentials would be stored encrypted on the user's machines and never transmitted anywhere other than developer.apple.com (i.e. Titanium would not store the password in the Axway/Appc cloud). I'd be curious what people think about supplying their Apple login to the Titanium build tools.Chris Barber I can see being for and against the best solution you laid out there. Its just a tough one today giving out your user/pass even if its said nothing is stored. I look forward to testing once you make that change so I can hardcode the team-id. Looking around it seems you were able to make a unique app prefix for each app when iOS development started 9 years ago and this is what I did. Looking around in developer.apple in Certificates, Identifiers & Profiles it doesn't seem like thats possible anymore and Apple wants everyone to just use the Team-ID to avoid this problem I guess. But the problem is for people who did what I did there is no fix because the appPrefix can't be changed for production apps that are already on the store.
After recent comments I've just make another test and I have to report that I've made some kind of mistake before my last comment. Maybe I was still using 6.1.2, so I confirm the problem is not fixed (I have different app prefix and team id).
Ti SDK master PR: https://github.com/appcelerator/titanium_mobile/pull/9468 Ti SDK 6_3_X PR: https://github.com/appcelerator/titanium_mobile/pull/9469 To test, you need to build an app for device where you do not have a
<team-id>
in the tiapp.xml and you have development provisioning profile where theappPrefix
differs from the list ofteam
in the provisioning profile. Since this is not easy to reproduce, perhaps someone from the community would be so kind to give this PR a go.Chris Barber I just tested this on my end and it seems to be working good with the team-id in my tiapp.xml. I will be working on my app all day so If I have any building to device issues I will update. But so far so good. Thank you so much for working on a fix for this. :)
I updated to 6.3.x and it DID NOT resolve the problem. Problem still exists. No problem what-so-ever before the Xcode9 / 6.2.x update Thank you for your continued effort, but there are some of us which are still experiencing this. Please do not mark it as resolved? :)
Cameron updating to 6.3.x won't fix it yet. You have to change the 2 files mentioned here https://github.com/appcelerator/titanium_mobile/pull/9469 I just copied them into my 6.3.x mobileSDK folder and it solved the problem till it gets merged.
@Donovan Lewis Well that exactly fixed it... Thanks a million!!!!!
[~dlewis23], [~ch] Be aware that PR referenced above introduces a bug for simulator builds. Sigh. A fix is on the way.
PR #3 Ti SDK master PR: https://github.com/appcelerator/titanium_mobile/pull/9473 Ti SDK 6_3_X PR: https://github.com/appcelerator/titanium_mobile/pull/9474 To test, do a iOS simulator build.
Chris Barber Thx. So far simulator seems to be a-ok, atleast for me
After updating the sdk and setting the team-id, I get this:
The provisioning is actually valid (recreated from scratch), and if I open the newly created Xcode project I can archive it without getting any error.
FR Passed. Changes are seen on master 7.0.0.v20171109120356