Fastlane failed to detect to iOS App Development provisioning profiles - ios

I am working with Fastlane script to set up automate ios build with CI/CD. During the build time, Fastlane was unable to detect the Development provisioning file. I am getting errors as follows
error: No profiles for 'my-app-identifier' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'my-app-identifie'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'My-target' from project 'App-scheme')
By default in Xcode the automatic settings code signing is enabled and tried to disable it. And have selected certificates after that I am able to build the ios application with Fastlane.
I have already provided the provisioning profile details of the build_app function. Is there any option to select provisioning profiles with Fastlane?
Fastfile
default_platform(:ios)
platform :ios do
before_all do |lane, options|
APP_ID=ENV['APP_ID']
APP_SCHEME=ENV['APP_SCHEME']
setup_ci
end
desc "Fetches the provisioning profiles so you can build locally and deploy to your device"
lane :certs do
match(app_identifier: [APP_ID], type: "appstore", readonly: true, git_branch: "new-2")
match(app_identifier: [APP_ID], type: "development", readonly: true, git_branch: "new-2")
match(app_identifier: [APP_ID], type: "adhoc", readonly: true, git_branch: "new-2")
end
desc "Description of what the lane does"
lane :beta do
# add actions here: https://docs.fastlane.tools/actions
# increment_build_number
connect_appstore_api
build_app(
scheme: APP_SCHEME,
export_method: "app-store",
output_directory: "./build/appstore/",
clean: true,
archive_path: "./build/build",
export_options: {
provisioningProfiles: {
APP_ID => "match AppStore #{APP_ID}",
}
}
)
# pilot
end
desc "Generate certificates"
lane :generate_certs do
connect_appstore_api
match(
app_identifier: [APP_ID],
type: "development",
readonly: false,
git_branch: "new-2"
)
match(
app_identifier: [APP_ID],
type: "adhoc",
readonly: false,
git_branch: "new-2"
)
match(
app_identifier: [APP_ID],
type: "appstore",
readonly: false,
git_branch: "new-2"
)
end
private_lane :connect_appstore_api do
app_store_connect_api_key(
duration: 1200, # optional (maximum 1200)
in_house: false,
is_key_content_base64: true
)
end
lane :check_ci do
if is_ci
puts "I'm a computer"
else
puts "Hi Human!"
end
end
end

Related

Jenkins pipeline with userinput extendedChoice returns the values with [ ] at the beginning and end

I added the below to the pipeline so while the pipeline is running - at some stage I want the user to choose from the parameters but the output returns with parentheses at beginning and end.
def envs = input(id: 'Upgarde', message: 'On which customer do you want to apply the upgrade?', submitter: 'admin', ok: 'Submit', parameters: [extendedChoice(defaultValue: env.ENV.split().toString(), description: '', descriptionPropertyValue: env.ENV.split().toString(), multiSelectDelimiter: '', name: 'Customers to upgrade', quoteValue: false, saveJSONParameterToFile: false, type: 'PT_MULTI_SELECT', value: env.ENV.split().toString())]).split(',')
Screenshot from the Jenkins UI:
enter image description here
Fixed by added .replace("[", "").replace("]", "")

How to handle multiple iOS targets (widgets) in fastlane

I'm trying to add widgets to our project and fastlane isn't able to automate anymore.
How do I edit the widget bundle identifier in fastlane
How do I set the right provisioning profile for the right target
Things I need:
in xcode the app target should have bundle identifier x.y.z
in xcode the widget target should have the bundle identifier x.y.z.widget
app target
widget target
in xcode the app target should have provisioning profile match adhoc x.y.z
in xcode the widget target should have provisioning profile match adhoc x.y.z.widget
app target signing
widget target signing
current Fastfile lane:
desc "Build the app and send it to Testflight for testing"
lane :build_adhoc do
UI.message("app_name: #{app_name}")
UI.message("app_identifier: #{app_identifier}")
UI.message("apple_id: #{apple_id}")
UI.message("team_id: #{team_id}")
UI.message("sku: #{sku}")
xcodeprojpath = "../ios/" + app_name + ".xcodeproj"
proj = Xcodeproj::Project.open("../" + xcodeprojpath)
proj.build_configurations.each do |item|
item.build_settings["DEVELOPMENT_TEAM"] = team_id
item.build_settings["PROVISIONING_PROFILE_SPECIFIER"] = match_ad_hoc_provisioning
item.build_settings["CODE_SIGN_IDENTITY[sdk=iphoneos*]"] = match_ad_hoc_signing
item.build_settings["SWIFT_VERSION"] = swift_version
item.build_settings["ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES"] = "YES"
end
proj.recreate_user_schemes
proj.save
begin
disable_automatic_code_signing
rescue => ex
UI.message("failed to disable automatic signing")
UI.error(ex)
end
get_certificates(
development: false,
username: apple_id,
team_id: team_id,
)
unlock_keychain(
password: keychainPassword,
)
#bumpBuildNumber
sigh(username: apple_id, adhoc: true, readonly: false, app_identifier: app_identifier, team_id: team_id) #force: false,
gym(export_method: "ad-hoc",
clean: true,
configuration: "Release",
codesigning_identity: match_ad_hoc_signing,
export_team_id: team_id,
skip_profile_detection: true,
export_options: {
method: "ad-hoc",
signingStyle: "manual",
provisioningProfiles: { "#{app_identifier}": "#{match_ad_hoc_provisioning}" },
})
end
gym(export_method: "ad-hoc",
clean: true,
configuration: "Release",
codesigning_identity: match_ad_hoc_signing,
export_team_id: team_id,
skip_profile_detection: true,
export_options: {
method: "ad-hoc",
signingStyle: "manual",
provisioningProfiles: { "#{app_identifier}": "#{match_ad_hoc_provisioning}" },
{ "#{widget_identifier}": "#{match_ad_hoc_provisioning_for_widget}" }
})
You can add one more key for widget in export_options->provisioningProfiles for specifying provisioning profile of widget.

Fastlane - undefined method configure for fastlane plugin

Following the documentation to create a custom plugin for fastlane.
Got an error while trying to use it :
Error in lane my_lane: undefined method `configure' for Fastlane::Mailjet:Module
It seems fastlane is trying to call a configure method somewhere.
However since there is no mention of it in the documentation i have absolutly no clue of what i should do.
Plugin available here : https://github.com/tirrorex/fastlane-plugin-mailjet
Call the action in my lane with
mailjet(
api_key: "key",
secret_key: "key",
sender: {
:email => "mail#mail.com",
:name => "Name"
},
recipients: options[:recipients],
subject: "subject",
textPart: "
Text.
",
templateLanguage: true,
templateErrorReporting: "mymail#mail.com",
templateErrorDeliver: "deliver",
templateId: id,
vars: {
"success":success,
"build_link": build_link,
},
attachments: attachments
)
The issue seems to be that in my plugin/action i use the mailjet gem.
When i try to call my mailjet action in my lane, fastlane instead is calling the mailjet gem which requires the configure method hence the error.
So it is a naming issue.
Any thoughts ?

Using HealthKit with Fastlane Match

I tried to enable the HealthKit capability in Xcode, but I got an error.
Add the HealthKit feature to your App ID.
Provisioning profile "match AdHoc com.mycompany.myapp" doesn't
support the HealthKit capability.
Can I fix this? Do I have to ignore it?
My Fastfile looks like that:
fastlane_version "2.35.1"
default_platform :ios
platform :ios do
before_all do
end
desc "Runs all the tests"
lane :test do
scan
end
desc "Build a new beta version"
desc "This will also make sure the profile is up to date"
lane :beta do
register_devices(
devices: {
...
}
)
match(type: "adhoc", force_for_new_devices: true)
gym(
scheme: "myapp",
clean: true,
silent: true,
output_directory: "../build/beta/"
)
end
desc "Deploy a new version to the App Store"
lane :release do
match(type: "appstore")
# snapshot
gym(
scheme: "myapp",
clean: true,
silent: true,
output_directory: "../build/release/"
)
end
end
I also tried to nuke everything, but it didn't help.

Rails Neo4j neo4j.config.session_path is deprecated, please use neo4j.config.session.path

I cannot understand this error neo4j.config.session_path is deprecated, please use neo4j.config.session.path. I get this in the myspec file during the testing. I updated Neo4j to version 9 from 7 and now I have this deprecation. I cannot understand what I should do because nowhere I cannot find the line is deprecated. I'm getting the error in the next lines of code:
describe "Edit Access" do
before :all do
Amendment.delete_all
a = Amendment.create(cid: "X1", namespace: "http://www.example.com", property: "question",
study_value: "ADEF", default_value: "A1", datatype: "string")
a = Amendment.create(cid: "X1", namespace: "http://www.example.com", property: "enabled",
study_value: "true", default_value: "true", datatype: "boolean")
a = Amendment.create(cid: "Y1", namespace: "http://www.example.com", property: "enabled",
study_value: "false", default_value: "true", datatype: "boolean")
ua_create
end
after :all do
Amendment.delete_all
ua_destroy
end
You should find neo4j.config.session_path defined somewhere in your app. Maybe search / grep for it? The places I would expect to find it are:
config/application.rb
config/environments/development.rb
config/environments/test.rb
config/environments/production.rb
Separately, I would make sure to read the upgrade guide for issues that may come up upgrading from 7.x to 8.x/9.x

Resources