Gowtham S
Gowtham S

Reputation: 37

How to fix the provisioning profile error in objective c?

After using Automatically manage signing also its showing the error.

1).WatchSwift Extension requires a provisioning profile. Select a provisioning profile for the "Debug" build configuration in the project editor.

2).Code signing is required for product type 'WatchKit Extension' in SDK 'watchOS 3.2'

Upvotes: 0

Views: 758

Answers (1)

codelover
codelover

Reputation: 1139

  1. Set the automatic provisioning profile for the WatchKit and WatchKit Extension target
  2. Go to Capabilities Tab and select the Appgroups then only you can use the WatchKit as its some dependency requirement.
  3. Go that the AppID on developer portal and link it with AppGroup ID created first in the AppGroup section and then enabling in the APPID liek you enable push.
  4. After this, the profiles will get expired So make sure to regenerate it again in the Profiles or else Xcode will regenerate it for you.

Once you have done all this you may see an APPNAME.entitlement file added to the Xcode project which looks something like thi:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>application-identifier</key>
    <string>TEAMID.com.yourapp.bundleID</string>
    <key>com.apple.security.application-groups</key>
    <array>
        <string>group.yourapp.bundleID</string> . //This is one your created in Apple AooGroup section.
    </array>
    <key>keychain-access-groups</key>
    <array>
        <string>TEAMID.yourkeychaingroups</string> //optional
    </array>
    <key>com.apple.developer.pass-type-identifiers</key>
    <array>
        <string>TEAMID.*</string>
    </array>
    <key>com.apple.developer.siri</key> . //optional
    <true/>
    <key>get-task-allow</key>
    <false/>
</dict>
</plist>

Note your details may vary based on your target.

WatchKit Target Entitlement may show this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>application-identifier</key>
    <string>TEAMID.com.yourapp.bundleID.watchkitapp</string>
    <key>keychain-access-groups</key>
    <array>
        <string>TEAMID.com.yourapp.bundleID.watchkitapp</string>
    </array>
</dict>
</plist>

WatchKitExtension Target Entitlement may show this:

   <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.security.application-groups</key>
    <array>
        <string>group.yourapp.bundleID</string>
    </array>
</dict>
</plist>

Finally refer the apple doc if still issue exist:https://developer.apple.com/library/content/documentation/IDEs/Conceptual/AppDistributionGuide/ConfiguringYourApp/ConfiguringYourApp.html

Upvotes: 1

Related Questions