question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't build on iOS with react-native 0.68-rc 4

See original GitHub issue

Hello,

I have the following error when building on iOS with react native :

❌  /Users/jbchauvin/Library/Developer/Xcode/DerivedData/Docavenue-fjjwzmdmhxmiqkeyzgkogbglnylk/Build/Products/Debug-iphonesimulator/Stripe/Stripe-umbrella.h:13:9: 'STDSAlreadyInitializedException.h' file not found

#import "STDSAlreadyInitializedException.h"
        ^


▸ Compiling ApplePayButtonManager.swift

❌  /Users/jbchauvin/Library/Developer/Xcode/DerivedData/Docavenue-fjjwzmdmhxmiqkeyzgkogbglnylk/Build/Products/Debug-iphonesimulator/Stripe/Stripe-umbrella.h:13:9: 'STDSAlreadyInitializedException.h' file not found

#import "STDSAlreadyInitializedException.h"
        ^


▸ Compiling ApplePayButtonView.swift

❌  /Users/jbchauvin/Library/Developer/Xcode/DerivedData/Docavenue-fjjwzmdmhxmiqkeyzgkogbglnylk/Build/Products/Debug-iphonesimulator/Stripe/Stripe-umbrella.h:13:9: 'STDSAlreadyInitializedException.h' file not found

#import "STDSAlreadyInitializedException.h"
        ^


▸ Compiling CardFormManager.swift

❌  /Users/jbchauvin/Library/Developer/Xcode/DerivedData/Docavenue-fjjwzmdmhxmiqkeyzgkogbglnylk/Build/Products/Debug-iphonesimulator/Stripe/Stripe-umbrella.h:13:9: 'STDSAlreadyInitializedException.h' file not found

#import "STDSAlreadyInitializedException.h"

I tried with different dependencies, but same problem…

  1. @stripe/stripe-react-native”: “0.2.4”
  2. @stripe/stripe-react-native”: “^0.4.0”

Additional informations 👍

    CPU: (10) x64 Apple M1 Pro
    Memory: 35.36 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.19.0 - ~/.nvm/versions/node/v14.19.0/bin/node
    Yarn: 1.22.17 - /opt/homebrew/bin/yarn
    npm: 6.14.16 - ~/.nvm/versions/node/v14.19.0/bin/npm
    Watchman: Not Found
  Managers:
    CocoaPods: 1.11.2 - /opt/homebrew/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
    Android SDK:
      API Levels: 27, 28, 29, 30, 31, 32
      Build Tools: 29.0.3, 30.0.2, 31.0.0, 32.0.0, 32.1.0
      System Images: android-32 | Google APIs ARM 64 v8a
      Android NDK: Not Found
  IDEs:
    Android Studio: 2021.1 AI-211.7628.21.2111.8193401
    Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild```

- React native version : 0.68 RC 4

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:13

github_iconTop GitHub Comments

1reaction
raedhellalcommented, Apr 15, 2022

I am facing the same issue any updates??

thanks

0reactions
JB-CHAUVINcommented, Jun 22, 2022

I fixed the issue with the following Podfile post install code :

def append_header_search_path(target, path)
    target.build_configurations.each do |config|
        xcconfig_path = config.base_configuration_reference.real_path

        # a positive lookbehind regular expression (?<=)
        # to keep the delimiter at the end of each string:
        file_data = File.read(xcconfig_path).split(/(?<=[\S])\n/)

        # Copy current headers
        header_search_paths = ""
        header_search_paths_index = nil
        file_data.select.with_index do |val, index|
          if /HEADER_SEARCH_PATHS/ =~ val
            header_search_paths = val
            header_search_paths_index = index
          end
        end

        # Append the new header
        new_header_search_paths = header_search_paths << " #{path}"
        file_data[header_search_paths_index] = new_header_search_paths

        # Write it back to the file
        file_data = file_data.join("\n")
        File.write(xcconfig_path, file_data)
    end
end

post_install do |installer|
  installer.generated_projects.each do |project|
     project.targets.each do |target|
    # https://github.com/stripe/stripe-react-native/issues/867
        puts "[INFO] Post install on target : #{target.name}"
        if target.name == 'stripe-react-native'
            target.build_configurations.each do |config|
                puts "[INFO] Updating #{target.name} --> #{config.name} HEADER_SEARCH_PATHS"
                append_header_search_path(target, "\"${PODS_ROOT}/Headers/Private/Stripe\"")
            end
        end
     end
  end
end
Read more comments on GitHub >

github_iconTop Results From Across the Web

Sebastien Lorber • ⚛️ ThisWeekInReact.com no Twitter ...
Preemptive Memoization In React Is Probably Not Evil (Yet) Great article, well-documented. Is using useMemo/useCallback aggressively a premature optimization ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found