cordova-ionic-phonegap-branch-deep-linking-attribution: Branch.h - iOS build doesn't work

Hello there, I’m also facing the issue with the missing Branch.h-File… Even tho I upgraded to the lastest cocoapods-release (1.9.1).


   Ionic CLI                     : 6.3.0 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 4.11.10
   @angular-devkit/build-angular : 0.803.25
   @angular-devkit/schematics    : 8.3.25
   @angular/cli                  : 8.3.25
   @ionic/angular-toolkit        : 2.1.2

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : ios 5.1.1
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.3, (and 25 other plugins)

Utility:

   cordova-res : 0.10.0
   native-run  : 0.3.0

System:

   ios-deploy : 1.9.4
   ios-sim    : 8.0.2
   NodeJS     : v10.15.3 (/usr/local/bin/node)
   npm        : 6.4.1
   OS         : macOS Mojave
   Xcode      : Xcode 11.3.1 Build version 11C505

Installed plugins:

$ cordova plugin ls
branch-cordova-sdk 4.1.2 "branch-cordova-sdk"
com.googlemaps.ios 3.5.0 "Google Maps SDK for iOS"
cordova-open-native-settings 1.5.2 "Native settings"
cordova-plugin-add-swift-support 2.0.2 "AddSwiftSupport"
cordova-plugin-androidx 1.0.2 "cordova-plugin-androidx"
cordova-plugin-androidx-adapter 1.1.0 "cordova-plugin-androidx-adapter"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-appavailability 0.4.2 "AppAvailability"
cordova-plugin-background-mode 0.7.3 "BackgroundMode"
cordova-plugin-badge 0.8.8 "Badge"
cordova-plugin-camera 4.1.0 "Camera"
cordova-plugin-customurlscheme 5.0.0 "Custom URL scheme"
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-enable-multidex 0.2.0 "Enable Multidex"
cordova-plugin-firebasex 9.0.1-cli "Google Firebase Plugin"
cordova-plugin-googlemaps 2.7.0-20191107-1035 "cordova-plugin-googlemaps"
cordova-plugin-inappbrowser 3.2.0 "InAppBrowser"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 4.1.3 "cordova-plugin-ionic-webview"
cordova-plugin-local-notification 0.9.0-beta.3 "LocalNotification"
cordova-plugin-market 1.2.0 "Market"
cordova-plugin-network-information 2.0.2 "Network Information"
cordova-plugin-qrscanner-dual 3.0.1 "QRScanner"
cordova-plugin-safariviewcontroller 1.6.0 "SafariViewController"
cordova-plugin-splashscreen 5.0.3 "Splashscreen"
cordova-plugin-statusbar 2.4.3 "StatusBar"
cordova-plugin-whitelist 1.3.4 "Whitelist"
cordova.plugins.diagnostic 5.0.1 "Diagnostic"
skwas-cordova-plugin-datetimepicker 2.0.0-alpha1 "DateTime picker"

I previously had installed an old cocoapods-version (1.7.2) and did now a clean update/reinstall to the newest version:

$ gem list --local | grep cocoa
cocoapods (1.9.1)
cocoapods-core (1.9.1)
cocoapods-deintegrate (1.0.4)
cocoapods-dependencies (1.3.0)
cocoapods-downloader (1.3.0)
cocoapods-plugins (1.0.0)
cocoapods-search (1.0.0)
cocoapods-stats (1.1.0)
cocoapods-trunk (1.4.1)
cocoapods-try (1.1.0)
$ pod repo list

cocoapods
- Type: git (master)
- URL:  https://github.com/CocoaPods/Specs.git
- Path: /Users/xxx/.cocoapods/repos/cocoapods

trunk
- Type: CDN
- URL:  https://cdn.cocoapods.org/
- Path: /Users/xxx/.cocoapods/repos/trunk

2 repos

But if I try to build via CLI it gives me following error:

** ARCHIVE FAILED **


The following build commands failed:
        CompileC /Users/xxx/Library/Developer/Xcode/DerivedData/xxx-grzgetsogbfrvkgrgaboqjaroujn/Build/Intermediates.noindex/ArchiveIntermediates/xxx\ Ionic\ 4/IntermediateBuildFilesPath/xxx\ Ionic\ 4.build/Debug-iphoneos/xxx.build/Objects-normal/arm64/BranchSDK.o /Users/xxx/Documents/xxx/src/Applications/xxx/platforms/ios/xxx/Plugins/branch-cordova-sdk/BranchSDK.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
xcodebuild: Command failed with exit code 65

–>

/Users/xxx/Documents/xxx/src/Applications/xxx/platforms/ios/xxx/Plugins/branch-cordova-sdk/BranchSDK.h:4:9: fatal error: 
      'Branch.h' file not found
#import "Branch.h"
        ^~~~~~~~~~
1 error generated.

Please let me know if you need any further information! Thanks in advance

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 8
  • Comments: 29 (5 by maintainers)

Most upvoted comments

Thanks @SidiBecker ! Actually the search headers are the only thing we needed to get this working.

I’ve created a hook which can be added to your Ionic project which will fix (workaround) the issue by adding these 2 header search paths automatically: https://gist.github.com/Sroose/d3db4178babbab1b39b68e9889e7869b

@ Branch team, I think this should be fixed in the Pod?

I have the same issue with version 4.1.3 and ionic 3 when building for IOS. I can build using xcode and that is fine but I can’t use ionic run with livereload because the build error kill the live reload server. This is slowing down the our development process a lot. Can’t even go back to plugin 3X due to the UIWebView and apple rejection problem (ITMS-90809). Is this going to be fixed in a new release or is there a workaround? Thanks

@noahcooper sorry about that, i totally dropped the ball on this patch release. Getting it out now.

Here is a PR that will help with this https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking-attribution/pull/660 while this gets merged and released you can add the hook @Sroose shared above. (Thanks @sysmo-dsv for the contribution)

Please note that some plugins still use the old CocoaPods way to resolve config dirs or other obscure ways that modify CocoaPods config causing other plugins to fail, since Branch is usually the first pod alphabetically, it’ll show up as the error when attempting to build the main project.

any news?

Any update from the Branch team? I’m stuck on v3.4.0 because of this issue

Hello. I found a solution for this error. I’m using Ionic 4.x and Xcode 11.4.1.

I removed the plugins folder: rm -rf plugins/

I installed/updated the following versions: npm i @ionic-cli@latest

ionic cordova plugin rm branch-cordova-sdk ionic cordova plugin add branch-cordova-sdk@4.1.3 npm i @ionic-native/branch-io@5.26.0

ionic cordova plugin rm cordova-open-native-settings ionic cordova plugin add cordova-open-native-settings@1.5.2 npm i @ionic-native/open-native-settings@5.26.0

I reinstalled the ios platform: ionic cordova platform rm ios ionic cordova platform add ios@5.1.1

Before executing the build command, I did the following procedures:

  • I opened the .xcworkspace file on platforms/ios/ folder;
  • I opened the “Build Settings” tab;
  • I searched for “Header Search Paths” and added the following paths in debug and release configuration: "${PODS_ROOT}/Branch/Branch-SDK/Branch-SDK" "${PODS_ROOT}/Branch/Branch-SDK/Branch-SDK/Networking"

With these procedures the build is successful and I no longer have the issue ITMS-90809 (UIWebView usage) when uploading my application. Hope this helps.

Works for me! Thanks!

Hello. I found a solution for this error. I’m using Ionic 4.x and Xcode 11.4.1.

I removed the plugins folder: rm -rf plugins/

I installed/updated the following versions: npm i @ionic-cli@latest

ionic cordova plugin rm branch-cordova-sdk ionic cordova plugin add branch-cordova-sdk@4.1.3 npm i @ionic-native/branch-io@5.26.0

ionic cordova plugin rm cordova-open-native-settings ionic cordova plugin add cordova-open-native-settings@1.5.2 npm i @ionic-native/open-native-settings@5.26.0

I reinstalled the ios platform: ionic cordova platform rm ios ionic cordova platform add ios@5.1.1

Before executing the build command, I did the following procedures:

  • I opened the .xcworkspace file on platforms/ios/ folder;
  • I opened the “Build Settings” tab;
  • I searched for “Header Search Paths” and added the following paths in debug and release configuration: "${PODS_ROOT}/Branch/Branch-SDK/Branch-SDK" "${PODS_ROOT}/Branch/Branch-SDK/Branch-SDK/Networking"

With these procedures the build is successful and I no longer have the issue ITMS-90809 (UIWebView usage) when uploading my application. Hope this helps.

I have the same issue with version 4.1.3 and ionic 3 when building for IOS. I can build using xcode and that is fine but I can’t use ionic run with livereload because the build error kill the live reload server. This is slowing down the our development process a lot. Can’t even go back to plugin 3X due to the UIWebView and apple rejection problem (ITMS-90809). Is this going to be fixed in a new release or is there a workaround? Thanks

I am facing the same problem using ionic 4. I also cannot go back to version 3.x of the plugin for the same reason as the depreciation of the UIWebView usage. I’m waiting for a correction.