cordova-ionic-phonegap-branch-deep-linking-attribution: 4.0.0 with Cordova 9.0.0 & Cordova-ios 5.0.1 "Branch.h" not found

Hi,

I’ve been trying to get cordova-ios with branch-cordova-sdk to build for IOS. It works fine for android (on windows) with my current setup but I get the following build error on mac while building for IOS:

Plugins/branch-cordova-sdk/BranchSDK.h:4:9: fatal error: 'Branch.h' file not
      found
#import "Branch.h"

I guess that something is failing to build branch.h, or it’s a path issue?

There is an error that comes out of pod install when I run cordova plugin add branch-cordova-sdk

[!] The [Debug] target overrides the 'LD_RUNPATH_SEARCH_PATHS' build setting [!] The [Release] target overrides the 'LD_RUNPATH_SEARCH_PATHS' build setting

But I have tried manually adding $(inherited): to those paths (where they are defined in the xcconfig files) and rerunning pod install which then runs without warnings, but still got the same failure when running cordova build ios

I’ve also tried adding and re-adding the platform and plugin etc

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 20 (3 by maintainers)

Most upvoted comments

@echo-branch I tried building from Xcode using the workspace and still got the error. I’m new to building with Xcode so I’d like to confirm that I took the right steps. In Xcode, I closed all open windows then opened MyApp.xcworkspace located in platforms/ios/. Then when it opened and the status bar showed “Ready”, I clicked the Build icon. A few moments after that it failed with the same Branch.h error. Did I go wrong somewhere?

My env: Cordova cli: 8.1.2 Cordova ios: 5.1.1 Branch: 4.0.0 Pod: 1.8.4

I tried forking the Cordova ios repo and commenting out the CONFIGURATION_BUILD_DIR line per this comment but even that didn’t work. 😦

@CodeWithOz

I tried all you did and was still having the same problem. The following worked for me in the end:

Remove any current ios platform from your project (cordova platform remove ios) Upgrade to Cordova v9 (sudo npm install -g cordova) Update Cocapods with the following couple of commands: pod repo update sudo gem install cocoapods add the ios platform back to your project Open the workspace file as you have done above and build in Xcode Note: I had to go to Signing & Capabilities section in XCode project to set the Team - you may also get an error about thi.

Other Note: I also got an error message about ‘Insecure world writable dir’ during the process of adding ios platform back in. If you experience the same use the following command to set appropriate permissions and re-add ios platform sudo chmod go-w /folder/listed/in/error/msg

Hope that fixes it for you!

@codinronan hi, CLI builds still fail, see #633 😦

@rupertbear hey, are CLI builds working for you after all that? Or only manual Xcode builds?

@echo-branch I tried building from Xcode using the workspace and still got the error. I’m new to building with Xcode so I’d like to confirm that I took the right steps. In Xcode, I closed all open windows then opened MyApp.xcworkspace located in platforms/ios/. Then when it opened and the status bar showed “Ready”, I clicked the Build icon. A few moments after that it failed with the same Branch.h error. Did I go wrong somewhere?

My env: Cordova cli: 8.1.2 Cordova ios: 5.1.1 Branch: 4.0.0 Pod: 1.8.4

I tried forking the Cordova ios repo and commenting out the CONFIGURATION_BUILD_DIR line per this comment but even that didn’t work. 😦