3
votes

I am using fastlane to build and send my app to testflight. This worked until I added a Notification Extension. Now it always gives me the error:

Error Domain=IDEProvisioningErrorDomain Code=9 ""OneSignalNotificationServiceExtension.appex" requires a provisioning profile with the App Groups feature." UserInfo={NSLocalizedDescription="OneSignalNotificationServiceExtension.appex" requires a provisioning profile with the App Groups feature., NSLocalizedRecoverySuggestion=Add a profile to the "provisioningProfiles" dictionary in your Export Options property list.}

Everything is supposed to be handled automatically on Xcode, and my fastfile looks like this:

default_platform(:ios)

platform :ios do
  before_all do
    increment_build_number
  end

  desc "Push a new beta build to TestFlight"
  lane :beta do
    get_certificates           # invokes cert
    get_provisioning_profile   # invokes sigh
    build_app(workspace: "MyApp.xcworkspace", scheme: "MyApp (Production)")
    pilot(skip_waiting_for_build_processing: true)
  end
end

My bundle identifier for my app is like com.myapp.ios and my bundle identifier for my notification service is like com.myapp.ios.notificationservice.

I've tried creating multiple provisioning profiles for the different bundle identifiers manually, but fastlane only selects one. How can I fix this?

1
I'm having the same issue, did you find a solution to this ? - cdn34
@cdn34 Yep, I just added my answer below. Let me know if that helps - Tometoyou

1 Answers

2
votes

I fixed this by changing my manually specifying the provisioning profiles in my fastfile like this:

default_platform(:ios)

platform :ios do
  before_all do
    increment_build_number
  end

  desc "Push a new beta build to TestFlight"
  lane :beta do
    get_certificates           # invokes cert
    get_provisioning_profile   # invokes sigh
    build_app(workspace: "MyApp.xcworkspace", 
    scheme: "MyApp (Production)", 
    export_method: "app-store",
        export_options: {
            provisioningProfiles: { 
                "com.myapp.ios" => "com.myapp.ios AppStore 1530397498",
                "com.myapp.ios.OneSignalNotificationServiceExtension" => "MyApp Notification Extension Provisioning Profile"
            }
        })
    pilot(skip_waiting_for_build_processing: true)
  end
end

If you want to use match, you can replace export_options with this:

match(
    app_identifier:["com.myapp.ios","com.myapp.ios.OneSignalNotificationServiceExtension"],
    type: "appstore"
)