2

I'm building a React Native app and am using Fastlane to manage my signing, building and deployment. I'm trying to build an ad-hoc package but each time I run the build using Fastlane gym, I get an error message about a missing header file. The build runs fine in Xcode from Product -> Build and I can run the app fine in my local simulators.

The error message I'm seeing is from gym AppDelegate.m:13:9: 'ReactNativeNavigation/ReactNativeNavigation.h' file not found, which I'm aware is associated with the React Native Navigation setup, and have followed the steps to fix it.

Has anyone seen this error before, or have any suggestions on how to get more information about why the Xcode build is working? I've tried scrubbing my build, pods and node_modules directories with no luck. I'm using React Native 0.59.9 and Xcode 11.3.1.

This is what I have in my Fastfile:

match(
  type: "adhoc",
  git_branch: "master",
  git_url: "<my cert repo>",
  app_identifier: ["<main app ID>", "<app extension ID"],
  team_id: "<my team ID>",
  readonly: true,
)
sh('yarn', 'build:ios')
gym(
  workspace: "myApp.xcworkspace",
  scheme: "myApp",
  configuration: "Beta",
  export_method: 'ad-hoc',
  output_directory: "builds",
  output_name: ipaName,
)

FYI, in this case yarn build:ios is an alias for react-native bundle --dev false --entry-file index.js --bundle-output ios/main.jsbundle --assets-dest ios --platform ios

Cœur
  • 37,241
  • 25
  • 195
  • 267
Mourndark
  • 2,526
  • 5
  • 28
  • 52

2 Answers2

1

You don't have to call yarn build:ios. gym should take care of it.

0

Azure DevOps CICD setup; here is complete solution
Note: ENV['variable'] are variables configured on Azure DevOps pipeline

  1. Add to Apple

    app_identifier("app.bundle.name") # The bundle identifier of your app
    
  2. put code in Gymfile

     scheme("ProjectSchemeName")
     export_options({
                    method: "app-store",
                    provisioningProfiles: { 
                    "app.bundle.name" =>  "Distribution-ProvisioningProfileName",
                       }
                   })
    
      # Specify the path to store .ipa file
      output_directory("./fastlane/builds")
      # Excludes bitcode from the build
      include_bitcode(false)
      # Excludes symbols from the build.
      include_symbols(false)
    
  3. add to Deliverfile

    # Indicates that it’s a free app.
    price_tier(0)
    # Answer the questions Apple would present to you upon manually submitting for review
    submission_information({
           export_compliance_compliance_required: false,
           export_compliance_encryption_updated: false,
           export_compliance_uses_encryption: false,
           content_rights_contains_third_party_content: false,
           add_id_info_uses_idfa: false,
           export_compliance_contains_third_party_cryptography: false,
           export_compliance_contains_proprietary_cryptography: false,
           content_rights_contains_third_party_content: false
         })
    
    # Contact information for the app review team.
    app_review_information(
           first_name: "Name",
           last_name: "Name",
           phone_number: "4324234324",
           email_address: "example@gmail.com",
           demo_user: "test@app.com",
           demo_password: "Password",
           notes: "This mobile application requires subscription."
     )
    
     automatic_release(false)
    
     reset_ratings(false)
    
     app_rating_config_path("./fastlane/metadata/app_store_rating_config.json")
    
     copyright("© 2022 organisation")
    
     primary_category("Business")
    
  4. update Fastfile to

     default_platform(:ios)
    
     platform :ios do
    
     desc "Description of what the lane does"
     lane :authenticate_app_stoe do
    
      #  APP STORE AUTHENTICATION USING API KEY
     app_store_connect_api_key(
          key_id: ENV['KEY_ID'],
          issuer_id: ENV['ISSUER_ID'],
          key_content: ENV['KEY_CONTENT'],
          is_key_content_base64: true,
          in_house: false
         )
     end
    
     # FASTLANE SYNC TO USE CERTIFICATES ON LOCAL MACHINE RATHER THAN CREATING NEW ONE.  
     desc "Sync certificates"
     lane :sync_certificates do
         #read-only disables match from overriding the existing certificates.
         match({readonly: true, type: "appstore"})
     end
    
     lane :set_build_number do 
          authenticate_app_store
          increment_version_number(version_number: ENV['APP_VERSION'])
          increment_build_number({ build_number: latest_testflight_build_number(version: ENV['APP_VERSION'], app_identifier: 'app.bundle.name') + 1 }) 
     end
    
     lane :deliver_metadata do
          authenticate_app_store
          deliver(
                  skip_binary_upload: true,
                  username: ENV['USERNAME'], #'example@gmail.com',
                  precheck_include_in_app_purchases: false,
                  automatic_release: false,
                  skip_app_version_update: false,
                  skip_screenshots: true,
                  force: true
                )
     end
    
     # LANE TO UPLOAD BUILD ON TESTFLIGHT
     desc "Create ipa"
     lane :beta_release do
          build
          upload_to_testflight()
     end
    
    
     desc "Create ipa"
     lane :build do
          set_build_number
          build_app
     end
    
     # LATE FOR BETA BUILD DEPLOYMENT
     desc "Create ipa"
     lane :release do
          build
          deliver_metadata
     end
    
     end
    
  5. app_store_rating_config.json example

     {
     "CARTOON_FANTASY_VIOLENCE": 0,
     "REALISTIC_VIOLENCE": 0,
     "PROLONGED_GRAPHIC_SADISTIC_REALISTIC_VIOLENCE": 0,
     "PROFANITY_CRUDE_HUMOR": 0,
     "MATURE_SUGGESTIVE": 0,
     "HORROR": 0,
     "MEDICAL_TREATMENT_INFO": 0,
     "ALCOHOL_TOBACCO_DRUGS": 0,
     "GAMBLING": 0,
     "SEXUAL_CONTENT_NUDITY": 0,
     "GRAPHIC_SEXUAL_CONTENT_NUDITY": 0,
     "UNRESTRICTED_WEB_ACCESS": 0,
     "GAMBLING_CONTESTS": 0
    }
    
Avinash Jadhav
  • 491
  • 4
  • 17