fastlane / fastlane

🚀 The easiest way to automate building and releasing your iOS and Android apps

Home Page:https://fastlane.tools

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gym build fails whilst XCode build succeeds (Multiple commands produce '../../AccessibilityResources.bundle')

joshuaaron opened this issue · comments

Issue Description

I have a react-native application that uses fastlane. When attempting to use gym for my iOS pipeline the build fails. When building through the xxx.xcworkspace in XCode, the build succeeds.

I've recently setup schemes and configurations for staging and production on the iOS app. Since then I haven't been able to get gym to complete a build successfully, though I've had it work prior. So if you require any extra information or config/screenshots here around my xcode config please let me know

Error:

[14:20:49]: ▸ ❌  error: Multiple commands produce '/Users/joshuaaron/Library/Developer/Xcode/DerivedData/<PROJECT-NAME>-fgvxllljilhimtehdlvfappvkdco/Build/Intermediates.noindex/ArchiveIntermediates/<PROJECT-NAME>Staging/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle':

Lane

platform :ios do
    # call from pkg.json and set the .env from fastlane/.env.staging
    lane :deploy_staging do
        sh "bundle exec fastlane ios release_staging --env staging"
    end

    private_lane :match_config do |options|
        api_key = app_store_connect
        match(
            type: options[:type],
            readonly: options[:readonly],
            api_key: api_key,
            force_for_new_devices: true,
        )
    end

    lane :sync_certificates do
        match_config(
            type: "development",
            readonly: true
        )
        match_config(
            type: "appstore",
            readonly: true
        )
    end

    lane :release_staging do |options|
        ensure_git_branch(branch: 'staging')
        ensure_git_status_clean
        cocoapods(clean_install: true)
        sync_certificates 
        gym(
            workspace: "./PROJECT-NAME.xcworkspace",
            scheme: ENV["GYM_SCHEME"],
            clean: true,
            silent: options.fetch(:silent, false),
            output_directory: "build"
        )
        pilot(
            skip_submission: true,
            skip_waiting_for_build_processing: true,
            app_identifier: ENV["APP_IDENTIFIER"]
        )
        clean_build_artifacts
    end
end
# package.json
"scripts": {
  "ios:deploy:staging": "cd ios && bundle exec fastlane deploy_staging"
}

I searched around and saw numerous comments to add in the post install to remove the React-Core.common-AccessibilityResources from project (added below):

Podfile

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

pod 'react-native-flipper', :path => '../node_modules/react-native-flipper/react-native-flipper.podspec', :configurations => ['Debug', 'Staging.Debug']

platform :ios, '11.0'

project 'PROJECT-NAME',
    'Staging.Debug' => :debug,
    'Staging.Release' => :release,
    'Debug' => :debug,
    'Release' => :release

target 'PROJECT-NAME' do
  config = use_native_modules!

  use_react_native!(
    :path => config[:reactNativePath],

    # to enable hermuse_flipper!({ 'Flipper' =>es on iOS, change `false` to `true` and then install pods
    :hermes_enabled => true
  )

  target 'PROJECT-NAMETests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable the next line.
  use_flipper!({ 'Flipper' => '0.127.0', configurations: ['Debug', 'Staging.Debug'] })
#  use_flipper!()


  post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
    installer.pods_project.targets.each do |target|
        if target.name == "React-Core.common-AccessibilityResources" 
          target.remove_from_project
        end
      end
  end
end

Since this is working fine in XCode, I'm wondering if there's any other setup I need in my fastlane config to get this to work correctly?

XCode config screenshots

Screen Shot 2022-06-02 at 3 28 44 PM Screen Shot 2022-06-02 at 3 27 25 PM

Console output where gym fails after match has successfully ran.

[14:20:36]: All required keys, certificates and provisioning profiles are installed 🙌
[14:20:36]: Setting Provisioning Profile type to 'app-store'
[14:20:36]: Cruising back to lane 'ios sync_certificates' 🚘
[14:20:36]: Cruising back to lane 'ios release_staging' 🚘
[14:20:36]: -----------------
[14:20:36]: --- Step: gym ---
[14:20:36]: -----------------
[14:20:36]: Resolving Swift Package Manager dependencies...
[14:20:36]: $ xcodebuild -resolvePackageDependencies -workspace ./PROJECT-NAME.xcworkspace -scheme Staging
[14:20:37]: ▸ Command line invocation:
[14:20:37]: ▸     /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -resolvePackageDependencies -workspace ./.xcworkspace -scheme PROJECT-NAMEStaging
[14:20:38]: ▸ resolved source packages: 
[14:20:38]: $ xcodebuild -showBuildSettings -workspace ./PROJECT-NAME.xcworkspace -scheme PROJECT-NAMEStaging
[14:20:41]: Detected provisioning profile mapping: {:"com.COMPANY-NAME.PROJECT-NAME.staging"=>"match AppStore com.COMPANY-NAME.PROJECT-NAME.staging"}

+--------------------------------------+--------------------------------------+
| Summary for gym 2.206.0 |
+--------------------------------------+--------------------------------------+
| workspace | ./PROJECT-NAME.xcworkspace |
| scheme | PROJECT-NAMEStaging |
| clean | true |
| silent | false |
| output_directory | build |
| export_method | app-store |
| export_options.provisioningProfiles | match AppStore |
| .com.COMPANY-NAME.PROJECT-NAME.stag | com.COMPANY-NAME.PROJECT-NAME.stagi |
| ing | ng |
| output_name | |
| skip_package_ipa | false |
| skip_package_pkg | false |
| build_path | /Users/joshuaaron/Library/Developer |
| | /Xcode/Archives/2022-06-02 |
| result_bundle | false |
| buildlog_path | ~/Library/Logs/gym |
| destination | generic/platform=iOS |
| xcodebuild_formatter | xcpretty |
| skip_profile_detection | false |
| xcodebuild_command | xcodebuild |
| skip_package_dependencies_resolutio | false |
| n | |
| disable_package_automatic_updates | false |
| use_system_scm | false |
| xcode_path | /Applications/Xcode.app |
+--------------------------------------+--------------------------------------+

[14:20:41]: $ set -o pipefail && xcodebuild -workspace ./.xcworkspace -scheme Staging -destination 'generic/platform=iOS' -archivePath /Users/joshuaaron/Library/Developer/Xcode/Archives/2022-06-02/\ 2022-06-02\ 14.20.41.xcarchive clean archive | tee /Users/joshuaaron/Library/Logs/gym/-Staging.log | xcpretty
[14:20:45]: ▸ Clean Succeeded
[14:20:49]: ▸ ❌ error: Multiple commands produce '/Users/joshuaaron/Library/Developer/Xcode/DerivedData/-fgvxllljilhimtehdlvfappvkdco/Build/Intermediates.noindex/ArchiveIntermediates/Staging/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle':
[14:20:49]: ▸ unexpected mutating task ('SetOwnerAndGroup joshuaaron:staff /Users/joshuaaron/Library/Developer/Xcode/DerivedData/-fgvxllljilhimtehdlvfappvkdco/Build/Intermediates.noindex/ArchiveIntermediates/Staging/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle') with no relation to prior mutator ('SetOwnerAndGroup joshuaaron:staff /Users/joshuaaron/Library/Developer/Xcode/DerivedData/-fgvxllljilhimtehdlvfappvkdco/Build/Intermediates.noindex/ArchiveIntermediates/Staging/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle') (in target 'React-Core-60309c9c-AccessibilityResources' from project 'Pods')
[14:20:49]: ▸ unexpected mutating task ('SetMode u+w,go-w,a+rX /Users/joshuaaron/Library/Developer/Xcode/DerivedData/-fgvxllljilhimtehdlvfappvkdco/Build/Intermediates.noindex/ArchiveIntermediates/Staging/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle') with no relation to prior mutator ('SetMode u+w,go-w,a+rX /Users/joshuaaron/Library/Developer/Xcode/DerivedData/-fgvxllljilhimtehdlvfappvkdco/Build/Intermediates.noindex/ArchiveIntermediates/Staging/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle') (in target 'React-Core-60309c9c-AccessibilityResources' from project 'Pods')
[14:20:49]: ▸ duplicate output file '/Users/joshuaaron/Library/Developer/Xcode/DerivedData/-fgvxllljilhimtehdlvfappvkdco/Build/Intermediates.noindex/ArchiveIntermediates/Staging/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle/en.lproj' on task: CpResource /Users/joshuaaron/Desktop/work/repos/PROJECT-NAME/node_modules/react-native/React/AccessibilityResources/en.lproj /Users/joshuaaron/Library/Developer/Xcode/DerivedData/-fgvxllljilhimtehdlvfappvkdco/Build/Intermediates.noindex/ArchiveIntermediates/Staging/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle/en.lproj (in target 'React-Core-AccessibilityResources' from project 'Pods')
[14:20:49]: ▸ duplicate output file '/Users/joshuaaron/Library/Developer/Xcode/DerivedData/-fgvxllljilhimtehdlvfappvkdco/Build/Intermediates.noindex/ArchiveIntermediates/Staging/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle' on task: MkDir /Users/joshuaaron/Library/Developer/Xcode/DerivedData/-fgvxllljilhimtehdlvfappvkdco/Build/Intermediates.noindex/ArchiveIntermediates/Staging/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle (in target 'React-Core-AccessibilityResources' from project 'Pods')
[14:20:49]: ▸ duplicate output file '' on task: MkDir /Users/joshuaaron/Library/Developer/Xcode/DerivedData/-fgvxllljilhimtehdlvfappvkdco/Build/Intermediates.noindex/ArchiveIntermediates/Staging/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle (in target 'React-Core-AccessibilityResources' from project 'Pods')
[14:20:49]: ▸ duplicate output file '/Users/joshuaaron/Library/Developer/Xcode/DerivedData/-fgvxllljilhimtehdlvfappvkdco/Build/Intermediates.noindex/ArchiveIntermediates/Staging/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle/Info.plist' on task: ProcessInfoPlistFile /Users/joshuaaron/Library/Developer/Xcode/DerivedData/-fgvxllljilhimtehdlvfappvkdco/Build/Intermediates.noindex/ArchiveIntermediates/Staging/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle/Info.plist /Users/joshuaaron/Desktop/work/repos/PROJECT-NAME/ios/Pods/Target Support Files/React-Core/ResourceBundle-AccessibilityResources-React-Core-Info.plist (in target 'React-Core-AccessibilityResources' from project 'Pods')
[14:20:49]: ▸ duplicate output file '' on task: RegisterExecutionPolicyException /Users/joshuaaron/Library/Developer/Xcode/DerivedData/-fgvxllljilhimtehdlvfappvkdco/Build/Intermediates.noindex/ArchiveIntermediates/Staging/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle (in target 'React-Core-AccessibilityResources' from project 'Pods')
[14:20:49]: ▸ duplicate output file '' on task: SetMode u+w,go-w,a+rX /Users/joshuaaron/Library/Developer/Xcode/DerivedData/-fgvxllljilhimtehdlvfappvkdco/Build/Intermediates.noindex/ArchiveIntermediates/Staging/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle (in target 'React-Core-AccessibilityResources' from project 'Pods')
[14:20:49]: ▸ duplicate output file '' on task: SetOwnerAndGroup joshuaaron:staff /Users/joshuaaron/Library/Developer/Xcode/DerivedData/-fgvxllljilhimtehdlvfappvkdco/Build/Intermediates.noindex/ArchiveIntermediates/Staging/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle (in target 'React-Core-AccessibilityResources' from project 'Pods')
[14:20:49]: ▸ duplicate output file '' on task: SetOwnerAndGroup joshuaaron:staff /Users/joshuaaron/Library/Developer/Xcode/DerivedData/-fgvxllljilhimtehdlvfappvkdco/Build/Intermediates.noindex/ArchiveIntermediates/Staging/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle (in target 'React-Core-AccessibilityResources' from project 'Pods')
[14:20:49]: ▸ duplicate output file '' on task: Touch /Users/joshuaaron/Library/Developer/Xcode/DerivedData/-fgvxllljilhimtehdlvfappvkdco/Build/Intermediates.noindex/ArchiveIntermediates/Staging/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle (in target 'React-Core-AccessibilityResources' from project 'Pods')
[14:20:49]: ▸ ** ARCHIVE FAILED **
[14:20:49]: Exit status: 65

+---------------+-------------------------+
| Build environment |
+---------------+-------------------------+
| xcode_path | /Applications/Xcode.app |
| gym_version | 2.206.0 |
| export_method | app-store |
| sdk | iPhoneOS14.0.sdk |
+---------------+-------------------------+
+------------------------------------+--------------------------------------+
| Lane Context |
+------------------------------------+--------------------------------------+
| ENVIRONMENT | staging |
| DEFAULT_PLATFORM | ios |
| PLATFORM_NAME | ios |
| LANE_NAME | ios release_staging |
| SIGH_PROFILE_TYPE | app-store |
| MATCH_PROVISIONING_PROFILE_MAPPING | {"com.COMPANY-NAME.PROJECT-NAME.sta |
| | ging"=>"match AppStore |
| | com.COMPANY-NAME.PROJECT-NAME.stagi |
| | ng"} |
+------------------------------------+--------------------------------------+
[14:20:49]: Error building the application - see the log above

+------+------------------------+-------------+
| fastlane summary |
+------+------------------------+-------------+
| Step | Action | Time (in s) |
+------+------------------------+-------------+
| 1 | default_platform | 0 |
| 2 | Switch to ios | 0 |
| | sync_certificates | |
| | lane | |
| 3 | Switch to ios | 0 |
| | match_config lane | |
| 4 | Switch to ios | 0 |
| | app_store_connect | |
| | lane | |
| 5 | app_store_connect_api | 0 |
| | _key | |
| 6 | match | 2 |
| 7 | Switch to ios | 0 |
| | match_config lane | |
| 8 | Switch to ios | 0 |
| | app_store_connect | |
| | lane | |
| 9 | app_store_connect_api | 0 |
| | _key | |
| 10 | match | 2 |
| 💥 | gym | 12 |
+------+------------------------+-------------+

Environment

✅ fastlane environment ✅

Stack

Key Value
OS 10.15.6
Ruby 2.6.3
Bundler? false
Git git version 2.23.0
Installation Source /usr/local/bin/fastlane
Host Mac OS X 10.15.6 (19G2021)
Ruby Lib Dir /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
OpenSSL Version LibreSSL 2.8.3
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode.app/Contents/Developer/
Xcode Version 12.0
Swift Version 5.3

System Locale

Variable Value
LANG en_US.UTF-8 ✅
LC_ALL en_US.UTF-8 ✅
LANGUAGE

fastlane files:

`./fastlane/Fastfile`
default_platform(:ios)

platform :ios do

    desc "The lane to call to build and deploy staging from package.json. Kicks off all the required steps and sets the correct env file"
    lane :deploy_staging do
        sh "bundle exec fastlane ios release_staging --env staging"
    end

    desc "Setup app store connect and retrieve the API key to be used within other lanes"
    private_lane :app_store_connect do
         app_store_connect_api_key(
            key_id: ENV["APP_STORE_CONNECT_KEY_ID"],
            issuer_id: ENV["APP_STORE_CONNECT_ISSUER_ID"],
            key_content: ENV["APP_STORE_CONNECT_API_KEY_B64"],
            is_key_content_base64: ENV["APP_STORE_CONNECT_API_KEY_IS_KEY_CONTENT_BASE64"],
        )
    end

    desc "Sync our code signing using match, it will use the api key avaiable through the context"
    private_lane :match_config do |options|
        api_key = app_store_connect

        should_nuke_existing = options.fetch(:nuke_existing, false);
        match_nuke(type: options[:type], api_key: api_key) if should_nuke_existing

        match(
            type: options[:type],
            readonly: options[:readonly],
            api_key: api_key,
            force_for_new_devices: true,
            # verbose: true,
        )
    end

    desc "Sync development and appstore (distribution) certificates with match through our config helper lane"
    lane :sync_certificates do
        match_config(
            type: "development",
            readonly: true
        )

        match_config(
            type: "appstore",
            readonly: true
        )
    end
    lane :bump do
        package = load_json(json_path: "../package.json")

        increment_build_number(
            xcodeproj: './' + package['name'] + '.xcodeproj'
        )
        increment_version_number(
            xcodeproj: './' + package['name'] + '.xcodeproj',
            version_number: package['version']
        )

        new_build_number = Actions.lane_context[Actions::SharedValues::BUILD_NUMBER]
        new_version_number = Actions.lane_context[Actions::SharedValues::VERSION_NUMBER]
        UI.important("Incremented iOS build number to #{new_build_number}")
        UI.important("Incremented iOS version number to #{new_version_number}")
    end

    desc 'Build and release a new version to Testflight'
    lane :release_staging do |options|
        ensure_git_branch(branch: 'staging')
        ensure_git_status_clean
        cocoapods(clean_install: true)
        sync_certificates
        gym(
            workspace: "./PROJECT-NAME.xcworkspace",
            scheme: ENV["GYM_SCHEME"],
            clean: true,
            silent: options.fetch(:silent, false),
            output_directory: "build"
        )
        pilot(
            skip_submission: true,
            skip_waiting_for_build_processing: true,
            app_identifier: ENV["APP_IDENTIFIER"]
        )
        clean_build_artifacts
    end

    # Handle updating development certificates
    private_lane :update_match_development_dependencies do
        match_config(
            type: "development",
            readonly: false
        )
    end

    # Handle updating appstore certificates
    private_lane :update_match_appstore_dependencies do
        match_config(
            type: "appstore",
            readonly: false
        )
    end

    lane :generate_new_certificates do
        update_match_development_dependencies
        update_match_appstore_dependencies
    end
end
`./fastlane/Appfile`
app_identifier(ENV["APP_IDENTIFIER"])
apple_id(ENV["APPLE_ID"])

fastlane gems

Gem Version Update-Status
fastlane 2.206.2 ✅ Up-To-Date

Loaded fastlane plugins:

Plugin Version Update-Status
fastlane-plugin-load_json 0.0.1 ✅ Up-To-Date
Loaded gems
Gem Version
did_you_mean 1.3.0
rouge 2.0.7
xcpretty 0.3.0
terminal-notifier 2.0.0
unicode-display_width 1.8.0
terminal-table 1.8.0
plist 3.6.0
addressable 2.8.0
multipart-post 2.0.0
word_wrap 1.0.0
optparse 0.1.1
tty-screen 0.8.1
tty-cursor 0.7.1
tty-spinner 0.9.3
artifactory 3.0.15
babosa 1.0.4
colored 1.2
highline 2.0.3
commander 4.6.0
faraday-em_http 1.0.0
faraday-em_synchrony 1.0.0
faraday-excon 1.1.0
faraday-httpclient 1.0.1
faraday-multipart 1.0.3
faraday-net_http 1.0.1
faraday-net_http_persistent 1.2.0
faraday-patron 1.0.0
faraday-rack 1.0.0
faraday-retry 1.0.3
ruby2_keywords 0.0.5
faraday 1.10.0
faraday-cookie_jar 0.0.7
faraday_middleware 1.2.0
fastimage 2.2.6
gh_inspector 1.1.3
mini_magick 4.11.0
naturally 2.2.1
rubyzip 2.3.2
security 0.1.3
xcpretty-travis-formatter 1.0.1
dotenv 2.7.6
bundler 2.3.9
simctl 1.6.8
jwt 2.3.0
google-apis-playcustomapp_v1 0.7.0
emoji_regex 3.2.3
rexml 3.2.5
nanaimo 0.3.0
colored2 3.1.2
claide 1.1.0
CFPropertyList 3.0.5
atomos 0.1.3
xcodeproj 1.21.0
public_suffix 4.0.7
excon 0.92.3
unf_ext 0.0.8.2
unf 0.1.4
domain_name 0.5.20190701
http-cookie 1.0.5
json 2.6.2
webrick 1.7.0
httpclient 2.8.3
multi_json 1.15.0
signet 0.16.1
os 1.1.4
memoist 0.16.2
googleauth 1.1.3
mini_mime 1.1.2
retriable 3.1.2
trailblazer-option 0.1.2
declarative 0.0.20
uber 0.1.0
representable 3.2.0
google-apis-core 0.5.0
google-apis-androidpublisher_v3 0.21.0
rake 13.0.6
digest-crc 0.6.4
google-apis-storage_v1 0.14.0
google-apis-iamcredentials_v1 0.10.0
google-cloud-errors 1.2.0
google-cloud-env 1.6.0
google-cloud-core 1.6.0
google-cloud-storage 1.36.2
aws-eventstream 1.2.0
aws-sigv4 1.5.0
aws-partitions 1.595.0
jmespath 1.6.1
aws-sdk-core 3.131.1
aws-sdk-kms 1.57.0
aws-sdk-s3 1.114.0
forwardable 1.2.0
logger 1.3.0
date 2.0.0
stringio 0.0.2
ipaddr 1.2.2
openssl 2.1.2
zlib 1.0.0
mutex_m 0.1.0
ostruct 0.1.0
strscan 1.0.0
io-console 0.4.7
fileutils 1.1.0
etc 1.0.1
libxml-ruby 3.1.0
psych 3.1.0
fastlane-plugin-load_json 0.0.1

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest fastlane version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

Friendly reminder: contributions are always welcome! Check out CONTRIBUTING.md for more information on how to help with fastlane and feel free to tackle this issue yourself 💪

This issue will be auto-closed if there is no reply within 1 month.

ezoic increase your site revenue