Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Branch.h - iOS build doesn't work #642

Open
adrenaline15 opened this issue Mar 23, 2020 · 29 comments
Open

Branch.h - iOS build doesn't work #642

adrenaline15 opened this issue Mar 23, 2020 · 29 comments

Comments

@adrenaline15
Copy link

adrenaline15 commented Mar 23, 2020

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 ([email protected])
   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

@felipeclopes
Copy link

felipeclopes commented Mar 31, 2020

I'm facing the same issue, and it happens both terminal and xCode.

Xcode: Version 11.4 (11E146)

Project dependencies:

$ ionic info

Ionic:

   Ionic CLI                     : 6.1.0 (/Users/myUser/.nvm/versions/node/v12.13.0/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.0.0
   @angular-devkit/build-angular : 0.900.1
   @angular-devkit/schematics    : 9.0.1
   @angular/cli                  : 9.0.1
   @ionic/angular-toolkit        : 2.0.0

Cordova:

   Cordova CLI       : 9.0.0 ([email protected])
   Cordova Platforms : ios 5.1.1
   Cordova Plugins   : cordova-plugin-ionic 5.4.5, cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.2, (and 14 other plugins)

Utility:

   cordova-res : 0.11.0
   native-run  : not installed

System:

   Android SDK Tools : 26.1.1 (/usr/local/share/android-sdk)
   ios-deploy        : 1.10.0
   ios-sim           : 8.0.2
   NodeJS            : v12.13.0 (/Users/myUser/.nvm/versions/node/v12.13.0/bin/node)
   npm               : 6.12.0
   OS                : macOS Catalina
   Xcode             : Xcode 11.4 Build version 11E146

Installed plugins:

> cordova plugin ls
branch-cordova-sdk 4.1.2 "branch-cordova-sdk"
cordova-annotated-plugin-android 1.0.4 "cordova-annotated-plugin-android"
cordova-plugin-androidx 1.0.2 "cordova-plugin-androidx"
cordova-plugin-androidx-adapter 1.1.0 "cordova-plugin-androidx-adapter"
cordova-plugin-badge 0.8.8 "Badge"
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-facebook4 6.3.0 "Facebook Connect"
cordova-plugin-firebasex 8.1.1 "Google Firebase Plugin"
cordova-plugin-health 1.1.3 "Cordova Health"
cordova-plugin-inappbrowser 3.2.0 "InAppBrowser"
cordova-plugin-ionic 5.4.5 "cordova-plugin-ionic"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 4.1.2 "cordova-plugin-ionic-webview"
cordova-plugin-local-notification 0.9.0-beta.2 "LocalNotification"
cordova-plugin-purchases 1.0.5 "Purchases"
cordova-plugin-splashscreen 5.0.3 "Splashscreen"
cordova-plugin-statusbar 2.4.3 "StatusBar"
cordova-plugin-whitelist 1.3.4 "Whitelist"

Build output:

ionic cordova build ios
In file included from /Users/myUser/Projects/myProject/ionic4/platforms/ios/myProject/Plugins/branch-cordova-sdk/BranchSDK.m:1:
/Users/myUser/Projects/myProject/ionic4/platforms/ios/myProject/Plugins/branch-cordova-sdk/BranchSDK.h:4:9: fatal error: 'Branch.h' file not found
#import "Branch.h"
        ^~~~~~~~~~
1 error generated.

...

warning: MobileCoreServices has been renamed. Use CoreServices instead. (in target 'Branch' from project 'Pods')
** ARCHIVE FAILED **


The following build commands failed:
	CompileC /Users/myUser/Library/Developer/Xcode/DerivedData/myProject-aoynxopuapcojndwtqkcbsfscfqw/Build/Intermediates.noindex/ArchiveIntermediates/myProject/IntermediateBuildFilesPath/myProject.build/Debug-iphoneos/myProject.build/Objects-normal/arm64/BranchSDK.o /Users/myUser/Projects/myProject/ionic4/platforms/ios/myProject/Plugins/branch-cordova-sdk/BranchSDK.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Command finished with error code 65: xcodebuild -workspace,myProject.xcworkspace,-scheme,myProject,-configuration,Debug,-destination,generic/platform=iOS,-archivePath,myProject.xcarchive,archive,CONFIGURATION_BUILD_DIR=/Users/myUser/Projects/myProject/ionic4/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/Users/myUser/Projects/myProject/ionic4/platforms/ios/build/sharedpch
xcodebuild: Command failed with exit code 65
Error: xcodebuild: Command failed with exit code 65
    at ChildProcess.whenDone (/Users/myUser/Projects/mighty/ionic4/node_modules/cordova-common/src/superspawn.js:135:23)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
[ERROR] An error occurred while running subprocess cordova.

Cocoapods:

cocoapods-1.9.1

@felipeclopes
Copy link

The issue was happening in my end due to opening the project not the workspace in Xcode.

It is fixed now!

@adrenaline15
Copy link
Author

adrenaline15 commented Apr 2, 2020

The issue was happening in my end due to opening the project not the workspace in Xcode.
It is fixed now!

You are absolutely right, if I'm opening the workspace (since the pods/dependent stuff get also imported via xcodeworkspace-file) in xcode I can build the project successfully; but thats not a suitable solution for me..

I would like to automate the building process without any necessary GUI-interaction. (aka via CLI)

@felipeclopes
Copy link

Our process is fully automated, the only steps we do have in our CI, is to make sure we have an updated enough pods gem and pods. The CI run pod repo update and pod install on the platform specific folder, before building it.

@AleCat83
Copy link

AleCat83 commented May 8, 2020

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

@sysmo-dsv
Copy link

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.

@SidiBecker
Copy link

SidiBecker commented May 24, 2020

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 [email protected]
npm i @ionic-native/[email protected]

ionic cordova plugin rm cordova-open-native-settings
ionic cordova plugin add [email protected]
npm i @ionic-native/[email protected]

I reinstalled the ios platform:
ionic cordova platform rm ios
ionic cordova platform add [email protected]

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.

@sysmo-dsv
Copy link

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 [email protected]
npm i @ionic-native/[email protected]

ionic cordova plugin rm cordova-open-native-settings
ionic cordova plugin add [email protected]
npm i @ionic-native/[email protected]

I reinstalled the ios platform:
ionic cordova platform rm ios
ionic cordova platform add [email protected]

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!

@Sroose
Copy link

Sroose commented May 26, 2020

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?

@SidiBecker
Copy link

Wonderful automation @Sroose. Thanks!

@noahcooper
Copy link

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

@jffs
Copy link

jffs commented Jun 26, 2020

any news?

@adrianyg7
Copy link
Contributor

Hey @adrenaline15 and @felipeclopes please refer to #604 (comment)

I have tried to reproduce this issue with a fresh ionic install but it's building and running fine.
Branch is usually the first plugin and/or Pod. I quote the following text from the same issue linked above

any build error in any pod will also cause it (because Branch is usually the first Pod, so it will come first alphabetically after the main project attempts to resolve Pod dependencies)

If you still have the same issue after this, please provide a minimal reproducible case.

@noahcooper
Copy link

noahcooper commented Jul 1, 2020

This can be reproduced by using branch-cordova-sdk along with cordova-plugin-facebook4 (as in the original description provided by @adrenaline15). If cordova-plugin-facebook4 is not included, the build succeeds.

@jffs
Copy link

jffs commented Jul 1, 2020

how we can fix it if have to use facebook plugin?

@adrianyg7
Copy link
Contributor

Here is a PR that will help with this #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.

@noahcooper
Copy link

Branch team, any thoughts on when the fix for this will be released?

@echo-branch
Copy link
Contributor

Sorry for the delay. There's some iOS 14 related work that we'd like to include with the next release and choose to delay a bit.

@noahcooper
Copy link

Version 4.2.0 of this plugin still fails when cordova-plugin-facebook4 is used.

@gopi-hl
Copy link

gopi-hl commented Aug 31, 2020

@echo-branch : We are not able to build an iOS build when we use your plugin. This is a work stoppage. Any ideas when this will get released - I am talking about the Branch.h file not found error

@mvaullerin
Copy link

We still have issues building our app with the 4.2.0 :

[...]/branch-cordova-sdk/BranchSDK.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
[cordova] (1 failure)
[cordova] xcodebuild: Command failed with exit code 65

It seems there is a conflict with cordova-plugin-googleplus: 8.5.0

@noahcooper
Copy link

Any update from the Branch team? Version 4 of this plugin has been broken for 6 months now. With upcoming iOS changes, it'll be important for all developers to move off of version 3.

@noahcooper
Copy link

Anything?

@echo-branch
Copy link
Contributor

@noahcooper
We believe the issue is plugin compatibility.

We have a potential fix on staging, which is waiting on an iOS patch release. You could try pointing there to see if it resolves the issue.

It would be pretty helpful if you could share what other 3rd party plugins you're using.

@noahcooper
Copy link

@echo-branch I'm encountering this issue when using this plugin with the cordova-plugin-facebook4 plugin.

@noahcooper
Copy link

Any chance of a release of this plugin sometime soon with the fix for this issue?

@echo-branch
Copy link
Contributor

echo-branch commented Nov 6, 2020

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

@noahcooper
Copy link

Yay, my build is working again. Thanks, Branch team!

@tamsel12
Copy link

No it is not working for me. Still getting the same issue while build the app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests