简体   繁体   中英

xcrun does not set rbenv shell version, .xcarchive is malformed. Fastlane, ios, react native

I am trying to deploy my ios react-native app to the AppStore, using fastlane to automate the deployment for beta testing with TestFlight. However, my fastlane beta command builds the app then fails after the archive succeeded in building.

The part failing is:

rbenv detected, removing env variables
rbenv: shell integration not enabled. Run `rbenv init' for instructions.
+ xcodebuild -exportArchive -exportOptionsPlist /var/folders/hq/xkbjj40x4gv1hx_q80vj7rh40000gn/T/gym_config20210223-39939-lz42w9.plist -archivePath './builds/project 2021-02-23 15.21.33.xcarchive' -exportPath /var/folders/hq/xkbjj40x4gv1hx_q80vj7rh40000gn/T/gym_output20210223-39939-1ehxxzu
error: archive at path '/Users/me/project/ios/builds/project 2021-02-23 15.21.33.xcarchive' is malformed
** EXPORT FAILED **

If I run xcrun rbenv init it produces the expected output, and my.zshrc and.bashrc contain eval "$(rbenv init -)" and xcrun has the same environment variables as my zsh. However, xcrun rbenv shell produces rbenv: shell integration not enabled. Run 'rbenv init' for instructions. rbenv: shell integration not enabled. Run 'rbenv init' for instructions. as well as running xcrun rbenv shell 2.6.3 . If rbenv shell 2.6.3 is run in zsh, rbenv is set to that version.

I suspect this may not be the cause of the issue, I've tried reinstalling xcode cli tools and reinstalling ruby. Before the Archive finishes in fastlane, the following warnings are given:

[15:27:18]: ▸     no rule to process file '/Users/me/project/ios/Pods/Flipper-RSocket/rsocket/benchmarks/CMakeLists.txt' of type 'text' for architecture 'arm64' (in target 'Flipper-RSocket' from project 'Pods')
[15:27:18]: ▸     no rule to process file '/Users/me/project/ios/Pods/Flipper-RSocket/rsocket/benchmarks/README.md' of type 'net.daringfireball.markdown' for architecture 'arm64' (in target 'Flipper-RSocket' from project 'Pods')
[15:27:18]: ▸     no rule to process file '/Users/me/project/ios/Pods/Flipper-RSocket/rsocket/README.md' of type 'net.daringfireball.markdown' for architecture 'arm64' (in target 'Flipper-RSocket' from project 'Pods')
[15:27:18]: ▸     no rule to process file '/Users/me/project/ios/Pods/Flipper-RSocket/rsocket/benchmarks/CMakeLists.txt' of type 'text' for architecture 'armv7' (in target 'Flipper-RSocket' from project 'Pods')
[15:27:18]: ▸     no rule to process file '/Users/me/project/ios/Pods/Flipper-RSocket/rsocket/benchmarks/README.md' of type 'net.daringfireball.markdown' for architecture 'armv7' (in target 'Flipper-RSocket' from project 'Pods')
[15:27:18]: ▸     no rule to process file '/Users/me/project/ios/Pods/Flipper-RSocket/rsocket/README.md' of type 'net.daringfireball.markdown' for architecture 'armv7' (in target 'Flipper-RSocket' from project 'Pods')

My Fastfile looks like:

default_platform(:ios)

platform :ios do
  desc "Push a new beta build to TestFlight"
  lane :beta do
    increment_build_number(xcodeproj: "project.xcodeproj")
    get_certificates( # Create or get certificate, and install it
      output_path: "./builds" # Download certificate in the build folder (you don't need to create the folder)
    )
    get_provisioning_profile( # Create or get provisioning profile
      output_path: "./builds",  # Download provisioning profile in the build folder
      filename: "provisioning.mobileprovision" # Rename the local provisioning profile
    )
    update_project_provisioning( # Set the project provisioning profile (related in Xcode to the General > Signing Release section)
      xcodeproj: "project.xcodeproj",
      target_filter: "project", # Name of your project
      profile: "./builds/provisioning.mobileprovision",
      build_configuration: "Release"
    )
    update_project_team( # Set the right team on your project
      teamid: CredentialsManager::AppfileConfig.try_fetch_value(:team_id)
    )
    build_app(
      workspace: "project.xcworkspace",
      scheme: "project",
      clean: true,
      export_method: "app-store",
      export_options: {
        provisioningProfiles: {
            CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier) => CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier) + " AppStore" # Value of this parameter is the name of the Provisioning Profile. By default, it will be "{bundleId} AppStore"
        }
      },
      build_path: "./builds",
      output_directory: "./builds")
    upload_to_testflight
  end
end

Podfile:

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

platform :ios, '10.0'

target 'project' do
  use_unimodules!
  config = use_native_modules!

  use_react_native!(:path => config["reactNativePath"])

  target 'projectTests' 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 these next few lines.
  use_flipper!({ 'Flipper-Folly' => '2.3.0' })
  post_install do |installer|
    flipper_post_install(installer)
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
      end
    end
end


  target 'project-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end
end

Had to update my mapbox package in package.json to a beta version that came out a week ago.

"@react-native-mapbox-gl/maps": "8.2.0-beta1",

https://github.com/react-native-mapbox-gl/maps/pull/1262

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM