Problems building iOS as dev on another company's team

EdHubbellEdHubbell USMember ✭✭

I convinced a company to go with Xamarin on the premise that if they ever wanted to move to iOS, we'd be all set. That day has come. As predicted based on my experience with Cordova, with iOS is it isn't so much the code as the distribution that would be challenging.

I can't seem to successfully sign and upload the iOS app so we can run it on TestFlight. I could probably do it on my own dev account, but not under their company account (even though I'm an admin).

To hash this out, we need details. Here they come. Over on https://developer.apple.com:

Under Identifiers, App IDs, we have:

Name: SomeAppName
Prefix: 2WXU6CAWT7
ID: com.somecompany.SomeAppName

The provisioning profile is like so:

Name: SomeAppName Dev Provisioning Profile
Type: iOS Distribution
App ID: SomeAppName (2WXU6CAWT7.com.somecompany.SomeAppName)
Certificates: 1 total

Back in Xamarin, we've got 2 ways to fail.

Situation 1:

If info.plist screen contents look like this:

Application Name: SomeAppName
Bundle Identifier: 2WXU6CAWT7.com.somecompany.SomeAppName

Then when we go to Build...iOS Bundle Signing screen, we get the dreaded 'No Matching Profiles Found' under Provisioning Profiles. This is with the Signing Identity set to Distribution: SomeCompany Inc. (2WXU6CAWT7)

This condition is no good - The app won't build due to the lack of a valid provisioning profile. More to the point, it won't build because Xamarin THINKS there is no matching provisioning profile.

Situation 2:

If we change the info.plist like so and cut out the company prefix:
Application Name: SomeAppName
Bundle Identifier: com.somecompany.SomeAppName

Then, it seems that things start to come together. Over in Build...iOS Bundle Signing, the Distribution and Provisioning Profile dropdowns contain the expected values (in this case, SomeAppName Dev Provisioning Profile). The app builds just fine.

Then we try to Archive for Publishing. Clicking on Validate and logging in allows me to choose an application. I choose my app, and I get the following error:

The Bundle ID specified in your info.plist (com.somecompany.SomeAppName) does not match the Bundle ID that was specified in iTunes connect (2WXU6CAWT7.com.somecompany.SomeAppName).

If I go ahead and try to sign and distribute anyway, we fritter 3 more minutes of our finite lifespan and get this from Application Loader:

No suitable application records were found. Verify your bundle identifier 'com.movesystems.77Fox' is correct.

I think what is happening is that somehow Xamarin is failing to look up and utilize the correct provisioning profile because it is ignoring the company prefix. The validation and upload errors make sense - the info.plist is wrong if it is set to com.somecompany.SomeAppName. It should be set to 2WXU6CAWT7.com.somecompany.SomeAppName in order for Apple to recognize it.

Anyone have a solution? Gladly paypal you a few beers if someone can get me an answer before the weekend.

~Ed

Posts

  • JimBennettJimBennett GBXamarin Team, Insider, University, Developer Group Leader ✭✭✭✭

    I think the issue is in your iTunes connect entry. If I look at my apps the prefix is never used anywhere - my bundle id is just com.blah.blah, not prefix.com.blah.blah.

    Change your iTunes connect app settings (think you have to create a new version first) to remove the prefix and give that a spin.

  • EdHubbellEdHubbell USMember ✭✭

    @JimBennett - Thanks for replying.

    When I create the app ID, I'm in developer.apple.com under the company team. It asks me when I log in what team I'm on. Then as soon as I add an App ID (using, for example, com.somecompany.SomeApp as the Explicit App ID), it starts to create an iOS App ID with an Identifier of 2WXU6CAWT7.com.somecompany.SomeApp.

    If I don't act as a member of that team, I can likely create an App ID without a prefix. But I'm pretty sure that would mean I'd be making an App that would be published under my name and not under the company. It doesn't make sense to me I'd create it when acting as myself. I'm worried if I do that then the app will be published under my name and not the company I'm doing the services for.

    Your suggestion does open up a possible workaround - I could just create the app as myself and then do a transfer. Do you know if that's what you've done? I could see how a transferred app would maintain its original prefix-less App ID because that probably can't change.

    I'll give that a shot, I guess, and report back. I'm on another job today so I may not reply until tonight. Thanks again for the suggestion.

    ~Ed

  • JimBennettJimBennett GBXamarin Team, Insider, University, Developer Group Leader ✭✭✭✭

    I did it all as myself - no app transfer at all. I've attached screenshots from the developer member centre and iTunes connect to show what I've got.

  • EdHubbellEdHubbell USMember ✭✭
    edited October 2015

    Got things figured out. Here's what happened, for those that come up with a similar problem.

    TLDR

    Create a new Apple ID every time you start developing apps for another organization.

    I had the company I was doing work for add me as a developer using my email address / Apple ID that I use all the time. Once they did that, I started getting a choice when logging in to https://developer.apple.com/. It wanted me to select a team. Sounds right, so I'd select the company I was doing work for. Let's call them Some Systems Inc.

    Right after choosing the Some Systems team, I was presented with some choices. One of them is Certificates and Identifiers. If I go there, I was able to create Certificates and Identifiers that really were associated with the Some Systems Inc team.

    There is also a iTunes Connect link. So clicking on that was how I would get to iTunes Connect, which was where I was making my app. What I didn't know was that iTunes Connect will not (and cannot) determine that I was acting on behalf of Some Systems Inc.

    To wit - the following paragraph taken from https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/SettingUpUserAccounts.html

    Important: Although both systems may use the same Apple ID for account validation, the iTunes Connect users and roles are separate from the Apple Developer Program membership and roles. A member of the Apple Developer Program for your organization doesn’t automatically have access to iTunes Connect. A member with an Admin role in the Apple Developer Program doesn’t automatically have an Admin role in iTunes Connect.

    What this means is that developer.apple.com is SMART. It can allow you to use the same Apple ID for multiple organizations/teams/etc. That's great.

    On the other hand, itunesconnect.apple.com is DUMB. It can't allow you to use the same Apple ID (which means the same email address) for multiple teams. And when linking from developer.apple.com, it doesn't even warn you that you are no longer acting on behalf of the team you chose when logging in.

    How can you tell? Look at the upper right corner of the screen when logged into iTunes connect. You can see in the screen shots below what it looks like for my personal dev account and my Some Systems account.

    (itunesconnect also won't allow you to ever delete an app you create unless you get the code approved. All those little app failures are with you for life, friends. DUMB.)

    Based on my experience, you'll want to do take a few steps before working with a company to produce apps for them.

    New Apple ID for Every New Company

    First, you need an Apple ID that is just for working with that company. Which means you need an email address that is just for working with that company. You are going to need an Apple ID to do anything in iTunes connect for them. If you use one of the email addresses you already have, then that email address is forever associated with that company in iTunes.

    What is more, if you give them an Apple ID that is already associated with iTunes connect, you'll end up where I was - Confused, alone, frustrated and afraid. But mostly just really frustrated. They'll say they gave you permissions, you'll actually have them on developer.apple.com, but not on itunes connect. Again, from iTunes connect:

    Existing Apple ID already associated with iTunes Connect. If a person’s Apple ID is already associated with another iTunes Connect organization, the user needs to provide a distinct email address that can be associated with the new organization; iTunes Connect creates an additional Apple ID for the user.

    Options for email addresses and Apple IDs:

    • Have them set up an email address for you in their system (like, say, [email protected]) that automatically forwards to some other email you own. Nice, but there is the lingering doubt that maybe someone in their email admin group deletes you one day.

    • If you are on the google, create an Apple ID using a + email address. So in this case, I could use [email protected] Apple accepts this as a valid email address and will create you a new Apple ID. All mail will still get to your gmail account. I haven't tested this all the way thru, but I'm going to by the end of the day.

    Use Meaningless SKUs when Creating iTunes Apps

    Apps you create will be around forever in iTunes Connect. You can do a lot of renaming - You can change the bundleID, etc. But you can't change the SKU. And you can't delete the app. If you just use a meaningless SKU, like a timestamp, then you can always repurpose that iTunesConnect app entry later. As of now, I'm stuck with several SomeSystemsMobile001 app entries that I'd never want to use again but can't delete.

    Thanks to @JimBennett for the screen shots that did help me get toward the right path - Message me with your paypal email and I'll send you a couple of beers. Or a nice martini.

  • JimBennettJimBennett GBXamarin Team, Insider, University, Developer Group Leader ✭✭✭✭

    @EdHubbell glad you got it all sorted! No need to paypal me a beer, happy to help!

  • Hi guys, I had the same problem, trying to sign an app for another company using an existing apple ID I use for other projects.

    After almost a day struggling to make Xamarin recognise the distribution provisioning profile I managed to get it working. That company had a few Distribution Certificates and I had a couple of them added to Keychain (not sure why) and wasn't sure which one I used to create the app ID. In the end I deleted all Certificates from Keychain and only downloaded the one that the app ID was using and it worked!

    Hope it helps if someone else is struggling and is in the "confused, alone, frustrated and afraid" zone.

  • keithfrancen.2612keithfrancen.2612 USUniversity

    I am having the same issue. I created a new email address and an apple id associated with that new email. I then had the company send me an invite to the email address. I added the email address to xcode. Visual Studio is still only showing my personal distribution signing profiles and not the company's enterprise distribution profiles. What am I missing?

Sign In or Register to comment.