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.
Related
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
I am using eas build for my expo-based react native app. I am unable to build for ios and keep getting the error during Install pods with the following error log:
106 [!] The following Swift pods cannot yet be integrated as static libraries:
107 The Swift pod FirebaseCoreInternal depends upon GoogleUtilities, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set use_modular_headers! globally in your Podfile, or specify :modular_headers => true for particular dependencies.
108 Error: Unknown error. See logs for more information.
I have searched many stackoverflow related questions which I have used in editing the Podfile at node_modules/react-native/template/ios/Podfile. An excerpt of the Podfile is shown below:
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
platform :ios, '12.4'
install! 'cocoapods', :deterministic_uuids => false
# added only these 5 lines to the Podfile
use_frameworks! :linkage => :static
pod 'Firebase', :modular_headers => true
pod 'FirebaseCoreInternal', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
use_modular_headers!
target 'HelloWorld' do
config = use_native_modules!
# Flags change depending on the env values.
flags = get_default_flags()
...
Questions:
Are the added 5 lines in the appropriate place in the code? I have tried adding them just below the
Do I have to edit code elsewhere apart from the Podfile? If yes, where and what code.
Been battling this for up to 2 weeks now. Any help would be most welcome.
Thanks
Searched and searched, and mixed and matched, and then trial and error. The following has worked for me.
In node_modules/react-native/template/ios/Podfile, i changed the Podfile to this
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
platform :ios, '13.0'
install! 'cocoapods', :deterministic_uuids => false
target 'HelloWorld' do
config = use_native_modules!
# Flags change depending on the env values.
flags = get_default_flags()
pod 'Firebase', :modular_headers => true
pod 'FirebaseCore', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
$RNFirebaseAsStaticFramework = true
use_react_native!(
:path => config[:reactNativePath],
# Hermes is now enabled by default. Disable by setting this flag to false.
# Upcoming versions of React Native may rely on get_default_flags(), but
# we make it explicit here to aid in the React Native upgrade process.
# :hermes_enabled => true,
:hermes_enabled => flags[:hermes_enabled],
:fabric_enabled => flags[:fabric_enabled],
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
# :flipper_configuration => FlipperConfiguration.enabled,
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
target 'HelloWorldTests' do
inherit! :complete
# Pods for testing
end
use_flipper!()
post_install do |installer|
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
end
Then also added plugins to my app.config.js (similarly if you are using app.json).
module.exports = {
expo: {
name: "appName",
slug: "appName",
scheme: "appName",
version: "1.0.0",
orientation: "portrait",
icon: "./assets/icon_1.png",
userInterfaceStyle: "light",
splash: {
image: "./assets/entry_page.png",
resizeMode: "contain",
backgroundColor: "#ffffff"
},
updates: {
fallbackToCacheTimeout: 0
},
assetBundlePatterns: [
"**/*"
],
ios: {
supportsTablet: true,
bundleIdentifier: "com.myaooo.appName"
},
android: {
adaptiveIcon: {
foregroundImage: "./assets/icon_1.png",
backgroundColor: "#FFFFFF"
},
package: "com.myaooo.appName",
versionCode: 5,
config: {
googleMaps: {
apiKey: process.env.PLACES_API_KEY
}
}
},
web: {
favicon: "./assets/favicon.png"
},
extra: {
eas: {
placesApiKey: process.env.PLACES_API_KEY,
youtTubeApiKey: process.env.YOUTUBE_API_KEY,
webApiKey: process.env.WEB_API_KEY,
firebaseApiKey: process.env.apiKey,
expoGoogleClientId: process.env.EXPO_GO_GOOGLE_CONSOLE_client_id,
expoAndroidId: process.env.EXPO_GO_GOOGLE_CONSOLE_androidClientId,
expoIosId: process.env.EXPO_GO_GOOGLE_CONSOLE_iosClientId,
clientID: process.env.WEB_clientId,
expoGoogleClientSecret: process.env.EXPO_GO_GOOGLE_CONSOLE_client_secret
}
},
plugins: [
[
"expo-build-properties",
{
android: {
compileSdkVersion:31,
targetSdkVersion:31,
buildToolsVersion:"31.0.0"
},
ios: {
deploymentTarget:"13.0",
useFrameworks: "static"
}
}
]
]
}
}
In essence you have to make modifications on the podfile (add the modular headers) and also on the app.json / app.config.js (add the plugins) files.
The current error I`m having is:
I build on android studio and no problem so far
Run pod install and everything checks out
I press build on XCode and this is the error I find.
Task :shared_core:linkPodDebugFrameworkIos FAILED
e: Could not find "/Users/xxxx/android/shared_core/build/classes/kotlin/ios/main/klib/shared_core.klib" in [/Users/xxxx/ios/Pods, /Users/mac/.konan/klib, /Users/mac/.konan/kotlin-native-prebuilt-macos-x86_64-1.6.10/klib/common, /Users/mac/.konan/kotlin-native-prebuilt-macos-x86_64-1.6.10/klib/platform/ios_x64]
It happens both with multiplatform 1.5.31 and 1.6.10.
Obs:
The file is there.
Both Xcode, Android Studio and Terminal and Cocoapods have Full Disk access.
Obs2: My Folder structure is
- root folder
- android folder
- ios folder
Obs3: My podspec file:
Pod::Spec.new do |spec|
spec.name = 'shared_core'
spec.version = '1.0'
spec.homepage = 'Link to the Shared Module homepage'
spec.source = { :git => "Not Published", :tag => "Cocoapods/#{spec.name}/#{spec.version}" }
spec.authors = ''
spec.license = ''
spec.summary = 'Some description for the Shared Module'
spec.vendored_frameworks = "build/cocoapods/framework/shared_core.framework"
spec.libraries = "c++"
spec.module_name = "#{spec.name}_umbrella"
spec.ios.deployment_target = '11'
spec.pod_target_xcconfig = {
'KOTLIN_PROJECT_PATH' => ':shared_core',
'PRODUCT_MODULE_NAME' => 'shared_core',
}
spec.script_phases = [
{
:name => 'Build shared_core',
:execution_position => :before_compile,
:shell_path => '/bin/sh',
:script => <<-SCRIPT
if [ "YES" = "$COCOAPODS_SKIP_KOTLIN_BUILD" ]; then
echo "Skipping Gradle build task invocation due to COCOAPODS_SKIP_KOTLIN_BUILD environment variable set to \"YES\""
exit 0
fi
set -ev
REPO_ROOT="$PODS_TARGET_SRCROOT"
"$REPO_ROOT/../gradlew" -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework \
-Pkotlin.native.cocoapods.platform=$PLATFORM_NAME \
-Pkotlin.native.cocoapods.archs="$ARCHS" \
-Pkotlin.native.cocoapods.configuration=$CONFIGURATION \
-Pkotlin.native.cocoapods.cflags="$OTHER_CFLAGS" \
-Pkotlin.native.cocoapods.paths.headers="$HEADER_SEARCH_PATHS" \
-Pkotlin.native.cocoapods.paths.frameworks="$FRAMEWORK_SEARCH_PATHS"
SCRIPT
}
]
end
And here's my PodFile:
target 'MyTarget' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
pod 'shared_core', :path => '../android/shared_core'
end
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
I really have no idea what's going one, this project built before, and nothing changed, and now it's not finishing the build.
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.
I have been following this guide to get a project on mine on CocoaPods. I am currently on the Testing section and am getting the error:
[!] No podspec found for `AppUpdateTracker` in /Users/aaron/Downloads/AUTCocoaPodsTest/AUTPodTest/Pods/AppUpdateTracker/AppUpdateTracker.podspec.json
Linting againt my repo works fine:
pod spec lint App-Update-Tracker.podspec
-> App-Update-Tracker (1.0.0)
Analyzed 1 podspec.
App-Update-Tracker.podspec passed validation.
And this is my Podspec:
Pod::Spec.new do |s|
s.name = "App-Update-Tracker"
s.version = "1.0.0"
s.summary = "AppUpdateTracker is a simple, lightweight iOS library intended to determine basic app install/update behavior."
s.description = <<-DESC
This library allows you to easily determine when the user uses your app after a fresh install, when the user updates your app (and the version from which (s)he updated, and how many times the user has opened a given version of your app. This library was created in order to help determine update information so that appropriate data migration logic could be run after an app update.
DESC
s.homepage = "https://github.com/Stunner/App-Update-Tracker"
s.license = { :type => "MIT", :file => "LICENSE.txt" }
s.author = { "Stunner" => "" }
s.social_media_url = "http://twitter.com/ajubbal"
s.platform = :ios
s.source = { :git => "https://github.com/Stunner/App-Update-Tracker.git", :tag => "1.0.0" }
s.source_files = "AppUpdateTracker"
s.requires_arc = true
end
Any idea on how to get around this issue?
It looks like your Pod names doesn't match:
The name of the pod is App-Update-Tracker but it's references as AppUpdateTracker.