Application not running in apple watch simulator due to bundle identifier issue - iphone

I'm building an apple watch application for which i created a AppGroup and also setting the provisioning profile and the certificate.
Now the issue is while building/running the "watchkit app" xcode is throwing an error saying,
warning: Capabilities that require entitlements from “appname WatchKit Extension/appname WatchKit Extension.entitlements" may not function in the Simulator because the provisioning profile specified in your build settings (“WatchKitProfile”) has an AppID of “com.id.watchApp” which does not match your bundle identifier “com.id.watchApp.watchkitextension”.
and nothing is showing in the applewatch simulator.But application is working fine in iPhone simulator.
Even the applewatch methods are not calling WKInterfaceController.openParentApplication
One more doubt, I'm using the appgroup which already used by other members.Will this create any problem or is this the issue for this warning.
Can anyone please help me on this.

When you create an App ID, you need to regenerate your provisioning profiles because they will not have the newly created App ID listed. Xcode can do this for you automatically as a "Fix Issue" prompt.
Ensure once you have created your App ID, you add it both the main app and the watch kit app extension via the capabilities tab and click on Fix Issues until it is all ok.

Related

Invalid WatchKit Support - The bundle contains an invalid implementation of WatchKit

I am trying to upload my apple watch app to iTunes, every time i am uploading my binary i am getting following mail from apple team.I have done with my following checklist.
Created separate App id and profile for watchapp and extension.
I have the correct set of images for apple watch as well as iOS app.
my app was initially built with Xcode 6.2 SDK and now i am submitting with 6.3 SDK.
Don't know where i am doing wrong. can anyone with experience help me out here.
We have discovered one or more issues with your recent delivery for
"XXXXX". To process your delivery, the following issues must be
corrected:
Invalid WatchKit Support - The bundle contains an invalid
implementation of WatchKit. The app may have been built or signed with
non-compliant or pre-release tools. Visit developer.apple.com for more
information.
Once these issues have been corrected, you can then redeliver the
corrected binary.
The problem for me was that the "IOS Deployment Target" in Build Settings for my WatchKit App and my WatchKit Extension were not both the same. My extension was set to 8.3 and my WatchKit App was set to 8.2. Once I set them both to 8.2 the error went away and the WatchKit App installed just fine.
While uploading apple watch app, it need to have apple watch extension into embedded binary of iOS app. But if you are habbitat to delete derived data then xcode6 will delete that target. and when you submit it to apple it will only get ios app not apple watch app.
Adding Embedded Binaries fails in Xcode
Xcode won't link framework form separate project
App crashes on device because of missing framework, works in simulator
Overview
After deleting the "DerivedData" folder (or performing a "Product > Clean") in xcode6, I cannot add CocoaTouch frameworks from another project to the "Embedded Binary" section (under General tab).
Or, Xcode hits a linker error because it cannot find a framework that if previously could.
Other symptoms
Clicking on the + under "Embedded Binaries" shows the Framework selector but selecting a framework in different project in the workspace does nothing.
I've been tearing my hair out over this one too. Here's what I've tried:
I've generated new provisioning profiles for the app, the watchkit extension, and the watchkit app, using unique bundle identifiers for each (com.example.app, com.example.app.watchkitextension & com.example.app.watchkitapp) and a distribution certificate. Downloaded, installed, and set each target to its own provisioning profile in Build Settings > Provisioning. Tried explicitly setting signing authority AND leaving it on automatic.
I've confirmed that the xcarchive contains a WatchKitSupport directory and WK file when I Show Package Contents of the archive
I've ensured that WatchKit Extension, WatchKit app, and IOS app all have matching build and version numbers
I ran Edit > Convert > To Latest Swift Syntax... on the app, extension, and watchkit targets (no source changes were required in my case..)
I've compiled from scratch, cleaned, built, & archived, rinsed and repeated, restarted system and looped again.
In my case, none of those worked. Hope one of them helps you. And if any other kind soul out there has fixed this without going bald, share the hair, man, share the hair.

New Swift app Lister error: "No matching provisioning profiles found", "App ID with Identifier ... is not available"

I downloaded the sample code for the Lister app from Apple's developer website and am trying to build the Swift version to my iPhone 5S running iOS 8 Beta 5. I've changed everything to com.mycompany.Lister, but when I try to build it, it comes up with the following error.
No matching provisioning profiles found
None of the valid provisioning profiles allowed the specified entitlements: com.apple.developer.ubiquity-container-identifiers. Xcode can resolve this issue by downloading a new provisioning profile from the Member Center.
So I click "Fix Issue", it loads for a few seconds and comes back to me with this message:
An App ID with Identifier 'com.example.apple-samplecode.Lister.ListerToday' is not available. Please enter a different string.
I thought I had already changed everything to com.mycompany.Lister, but maybe I'm missing something hidden somewhere.
In your Build Settings change the Code Signing Identities from Distribution to Developer or don't code sign.
As per #markerberg's comment: The trick is to go through the compile settings for all 8 items (toggle via drop down in the upper left corner of build settings). For each of the targets you need to change all the code signing options to "don't code sign". Then it works right away.
I fixed this by creating an "App Store" distribution provisioning profile for my App on the developer.apple.com provisioning portal. The reasoning is outlined here. https://developer.apple.com/library/ios/qa/qa1830/_index.html
I am fairly sure that Xcode did this for me automatically last time I created an objective-C app, but this is my first Swift app and somehow it seems i had to do it manually even though I was just submitting for beta testing via TestFlight.
I was following instructions mentioned in the ReadMe file provided with the source code (It is called iOS and Watch Quick Start). But while using Xcode's 'Fix Issue' option for creating Provisioning Profiles, I was getting the error mentioned above.
I had to quit and restart Xcode to solve this issue. After restarting Xcode, Fix Issue option seemed to be working for me.

Testing apps on iOS 6 device using the wildcard provisioning profile

I have spent the past 5 hours trying to make this work but unfortunately all attempts have failed. The process of testing apps on an actual iPhone is extremely frustrating for beginners such as myself compared to other platforms so I am hoping you guys can give me hints on what I am doing wrong here.
I have registered for an iOS developer account and paid the $99 and my account creation is completed. After letting Xcode do certificate registration, adding device and provisioning profiles I have the following automatically created for me:
In the developer portal - Certificates, Identifiers & Profiles
Under Certificates I have the following created:
iOS Development
iOS Distribution
Under Identifiers I have the following created:
Xcode iOS Wildcard App ID
Under Devices I have the following created:
My iPhone Name with its UDID
Under Provisioning Profiles I have the following created:
iOS Team Provisioning Profile with its App ID set to Xcode iOS Wildcard App ID (*)
From what I've read, I should be able to test apps without having to create a new App ID as long as they don't use certain features that require App ID such as push notification.
So I went on and I created a new project in Xcode called HelloWorld. Running the application caused the error: Code Sign error: A valid provisioning profile matching the application's Identifier 'com.test.HelloWorld' could not be found
After reading some more articles (which all of them seem to be outdated as none reflect the new UI of the apple developer portal) I have done the following in Xcode:
Under Build Settings -> Code Signing and I set it to iPhone Distribution: MyName (XXXXXXX)
but that didn't fix anything.
So in short my question is how do I deploy and test an application to my device using this wildcard provisioning profile?
All you really have to do is: Open Xcode, Open "Window -> Organizer".
Go to "Provisioning Profiles".
Click "Refresh" bottom right.
Log in with your dev Apple ID and Xcode will generate all required profiles
Follow these steps (omit if you have done any of these, and I'm assuming that you've already created the certificates)
1 - Create a wildcard AppId e.g com.yourcompany.test.*
2 - Create a provisioning profile (development) using this identifier
3 - Set identifier of your app to com.yourcompany.test.myapp
4 - Build & run it will work.
First Check you have a valid status in your xcode>organiser
and you are signing with right dev. profile and make sure all your devices are added in the profile.
In Xcode 6 you need to go to Xcode->Preferences.., go to the Accounts tab and select your apple id, then press "View details..". Finally press the refresh button.

cannot get app onto iphone to test

Im trying to test my first iphone app on a device. ive been through the walkthrough in the apple development portal that takes you through creating certificates, installing them and creating provisioner profile for the phone and installing it onto the phone. all was going well until i got to the end when it told me to select my device (that is connected to the mac) from the drop down menu in the top left of xcode then build and run the app. My device wasnt listed, i had two simulators and one that just said IOS device, i tried building to the 'IOS device' one and it built successfully but nothing was showing on the phone. So i tried googling the problem where someone suggested restarting, after i restarted i tried building again but got this error:
Code Sign error: The identity 'iPhone Distribution' doesn't match any valid certificate/private key pair in the default keychain
now i generated the everything from the same mac so i dont understand how the key pair doesnt match up. Help!?
I was getting the samething. Have a look on iOS provisioning portal page under provisioning profiles. You might have an out of date profile? If not open xcode and go to the organizer window under the window menu and look at your profiles. It could even be that you havn't added the device to the provisioning profile. sorry if im not making sense there are just alot of things to check.
iOS Provisioning Page

"no valid aps-environment entitlement found for application"

I am encountering this error when I am loading an Ad Hoc build of my Push Notification enabled iPhone app onto my device:
no valid aps-environment entitlement found for application
What does it mean, and how do I repair it?
I found the solution. In my project info under Build > Code Signing Identity I had it set to automatic, and it was selecting an AdHoc distribution profile which did not have push notifications enabled. (It was the wrong one.) I have selected the correct profile and the error is gone.
Push Notifications must be enabled for your App ID before creating a Provision Profile.
So, in this order:
Create your APP ID
Enable APNS
Create the Provisioning Profile
You have to enable Target—> capabilities—> push notification. I have faced this issue using Xcode 8.1.
In my case Xcode had invalidated the provisioning profile (it will say so in the Member Center).
What worked was to refresh all the provisioning profiles in Xcode after enabling Push for the app in the Member Center.
Here is Apples guide to refresh all the provisioning profiles on your computer. https://developer.apple.com/library/prerelease/ios/documentation/IDEs/Conceptual/AppDistributionGuide/MaintainingProfiles/MaintainingProfiles.html#//apple_ref/doc/uid/TP40012582-CH30-SW26
In short open Xcode and do the following:
In the Xcode Preferences window, click Accounts.
Select your team, and click View Details.
In the dialog that appears, click the Refresh button in the
lower-left corner under the Provisioning Profiles table.
Xcode updates the list of profiles in the Provisioning Profiles table.
Generate a Provision Profile specific for your App ID (Push Notifications Enabled), do not use the widlcard ones
I kept going through the process over and over again with one mistake...
the Provisioning profile i kept on using was DEVELOPMENT this WILL NOT WORK
you NEED to use ADHOC provisioning profile
if you didn't write the original code and aren't 100% sure on how it works, make sure that you have it set up to receive the right type of push notification token. had a problem where the app i was working on was only set up tokens on a release build. it's worth a try if nothing else works and you think your code is set up properly -- find the steps online somewhere to do a ad-hoc build and try it
It'll work even with a development profile but if you add in APN (Apple Push Notifications) after the fact make sure to go into member center and open the provisioning profile again (my said invalid), just opening it and closing it made it valid again and then I updated my profiles in Xcode via settings and everything worked just fine.
In my case, I renamed the App. So the provisioning profile was generated for the old App-ID. All I had to do, was to change the App-ID and add an new provisioning profile with the new App-ID.
For IONIC USERS:-
CAUSE:- If you are running your app in iphone using "ionic run ios" then this will also cause the same problem.
SOLUTION:- instead you must run your ios app using XCODE to install app into iphone.
SOLVED MY PROBLEM!!!!