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

Build fail on ios 10 #226

Closed
barocsi opened this issue Oct 13, 2016 · 8 comments
Closed

Build fail on ios 10 #226

barocsi opened this issue Oct 13, 2016 · 8 comments
Assignees

Comments

@barocsi
Copy link

barocsi commented Oct 13, 2016

I always afraid when upgrading Branch products.
After upgraded to latest plugin I get this error when compiling in cordova for emulator:

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_CSSearchableIndex", referenced from:
      objc-class-ref in BranchCSSearchableItemAttributeSet.o
  "_OBJC_CLASS_$_CSSearchableItem", referenced from:
      objc-class-ref in BranchCSSearchableItemAttributeSet.o
  "_OBJC_CLASS_$_CSSearchableItemAttributeSet", referenced from:
      _OBJC_CLASS_$_BranchCSSearchableItemAttributeSet in BranchCSSearchableItemAttributeSet.o
  "_OBJC_METACLASS_$_CSSearchableItemAttributeSet", referenced from:
      _OBJC_METACLASS_$_BranchCSSearchableItemAttributeSet in BranchCSSearchableItemAttributeSet.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

And these errors are occur when running on device from XCode:

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_CSSearchableItem", referenced from:
      objc-class-ref in BranchCSSearchableItemAttributeSet.o
  "_OBJC_METACLASS_$_CSSearchableItemAttributeSet", referenced from:
      _OBJC_METACLASS_$_BranchCSSearchableItemAttributeSet in BranchCSSearchableItemAttributeSet.o
  "_OBJC_CLASS_$_CSSearchableIndex", referenced from:
      objc-class-ref in BranchCSSearchableItemAttributeSet.o
  "_OBJC_CLASS_$_CSSearchableItemAttributeSet", referenced from:
      _OBJC_CLASS_$_BranchCSSearchableItemAttributeSet in BranchCSSearchableItemAttributeSet.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
@renesansz
Copy link
Contributor

@barocsi , I cannot reproduce the error that you're having.
Try to uninstall the plugin first then remove the platforms folder. Re-install the platforms again and install the plugin. let me know if this fixes the problem.

@hx-markterry
Copy link

hx-markterry commented Oct 17, 2016

I had the same issue, so I removed the platforms and plugins directories and tried again but the same problem. The linking error above is normally due to missing source files from the xcode project config.

After looking at the list of files in the iOS section of the config.xml I noticed that there is a difference in the latest version of the file on NPMJS and the latest version on GitHub:

GitHub version:

<header-file src="src/ios/BranchNPM.h" />
<header-file src="src/ios/BranchSDK.h" />
<source-file src="src/ios/BranchSDK.m" />
<source-file src="src/ios/AppDelegate+BranchSdk.m" />
<framework custom="true" src="src/ios/dependencies/Branch.framework" />

NPMJS version:

<header-file src="src/ios/BranchNPM.h" />
<header-file src="src/ios/BranchSDK.h" />
<source-file src="src/ios/BranchSDK.m" />
<source-file src="src/ios/AppDelegate+BranchSdk.m" />

<header-file src="src/ios/dependencies/Fabric/ANSCompatibility.h" />
<header-file src="src/ios/dependencies/Fabric/Answers.h" />
<header-file src="src/ios/dependencies/Fabric/FABAttributes.h" />
<header-file src="src/ios/dependencies/Fabric/FABKitProtocol.h" />
<header-file src="src/ios/dependencies/Fabric/Fabric+FABKits.h" />
<header-file src="src/ios/dependencies/Fabric/Fabric.h" />

<header-file src="src/ios/dependencies/Branch-SDK/BNCCallbacks.h" />
<header-file src="src/ios/dependencies/Branch-SDK/BNCConfig.h" />
<header-file src="src/ios/dependencies/Branch-SDK/BNCContentDiscoveryManager.h" />
<source-file src="src/ios/dependencies/Branch-SDK/BNCContentDiscoveryManager.m" />
<header-file src="src/ios/dependencies/Branch-SDK/BNCDeviceInfo.h" />
<source-file src="src/ios/dependencies/Branch-SDK/BNCDeviceInfo.m" />
<header-file src="src/ios/dependencies/Branch-SDK/BNCEncodingUtils.h" />
<source-file src="src/ios/dependencies/Branch-SDK/BNCEncodingUtils.m" />
<header-file src="src/ios/dependencies/Branch-SDK/BNCError.h" />
<source-file src="src/ios/dependencies/Branch-SDK/BNCError.m" />
<header-file src="src/ios/dependencies/Branch-SDK/BNCFabricAnswers.h" />
<source-file src="src/ios/dependencies/Branch-SDK/BNCFabricAnswers.m" />
<header-file src="src/ios/dependencies/Branch-SDK/BNCLinkCache.h" />
<source-file src="src/ios/dependencies/Branch-SDK/BNCLinkCache.m" />
<header-file src="src/ios/dependencies/Branch-SDK/BNCLinkData.h" />
<source-file src="src/ios/dependencies/Branch-SDK/BNCLinkData.m" />
<header-file src="src/ios/dependencies/Branch-SDK/BNCPreferenceHelper.h" />
<source-file src="src/ios/dependencies/Branch-SDK/BNCPreferenceHelper.m" />
<header-file src="src/ios/dependencies/Branch-SDK/BNCServerInterface.h" />
<source-file src="src/ios/dependencies/Branch-SDK/BNCServerInterface.m" />
<header-file src="src/ios/dependencies/Branch-SDK/BNCServerRequestQueue.h" />
<source-file src="src/ios/dependencies/Branch-SDK/BNCServerRequestQueue.m" />
<header-file src="src/ios/dependencies/Branch-SDK/BNCServerResponse.h" />
<source-file src="src/ios/dependencies/Branch-SDK/BNCServerResponse.m" />
<header-file src="src/ios/dependencies/Branch-SDK/BNCStrongMatchHelper.h" />
<source-file src="src/ios/dependencies/Branch-SDK/BNCStrongMatchHelper.m" />
<header-file src="src/ios/dependencies/Branch-SDK/BNCSystemObserver.h" />
<source-file src="src/ios/dependencies/Branch-SDK/BNCSystemObserver.m" />
<header-file src="src/ios/dependencies/Branch-SDK/Branch-SDK-Prefix.pch" />
<header-file src="src/ios/dependencies/Branch-SDK/Branch.h" />
<source-file src="src/ios/dependencies/Branch-SDK/Branch.m" />
<header-file src="src/ios/dependencies/Branch-SDK/BranchActivityItemProvider.h" />
<source-file src="src/ios/dependencies/Branch-SDK/BranchActivityItemProvider.m" />
<header-file src="src/ios/dependencies/Branch-SDK/BranchCSSearchableItemAttributeSet.h" />
<source-file src="src/ios/dependencies/Branch-SDK/BranchCSSearchableItemAttributeSet.m" />
<header-file src="src/ios/dependencies/Branch-SDK/BranchConstants.h" />
<source-file src="src/ios/dependencies/Branch-SDK/BranchConstants.m" />
<header-file src="src/ios/dependencies/Branch-SDK/BranchContentDiscoverer.h" />
<source-file src="src/ios/dependencies/Branch-SDK/BranchContentDiscoverer.m" />
<header-file src="src/ios/dependencies/Branch-SDK/BranchContentDiscoveryManifest.h" />
<source-file src="src/ios/dependencies/Branch-SDK/BranchContentDiscoveryManifest.m" />
<header-file src="src/ios/dependencies/Branch-SDK/BranchContentPathProperties.h" />
<source-file src="src/ios/dependencies/Branch-SDK/BranchContentPathProperties.m" />
<header-file src="src/ios/dependencies/Branch-SDK/BranchDeepLinkingController.h" />
<header-file src="src/ios/dependencies/Branch-SDK/BranchLinkProperties.h" />
<source-file src="src/ios/dependencies/Branch-SDK/BranchLinkProperties.m" />
<header-file src="src/ios/dependencies/Branch-SDK/BranchUniversalObject.h" />
<source-file src="src/ios/dependencies/Branch-SDK/BranchUniversalObject.m" />
<header-file src="src/ios/dependencies/Branch-SDK/BranchView.h" />
<source-file src="src/ios/dependencies/Branch-SDK/BranchView.m" />
<header-file src="src/ios/dependencies/Branch-SDK/BranchViewHandler.h" />
<source-file src="src/ios/dependencies/Branch-SDK/BranchViewHandler.m" />

<header-file src="src/ios/dependencies/Branch-SDK/Requests/BNCServerRequest.h" />
<source-file src="src/ios/dependencies/Branch-SDK/Requests/BNCServerRequest.m" />
<header-file src="src/ios/dependencies/Branch-SDK/Requests/BranchCloseRequest.h" />
<source-file src="src/ios/dependencies/Branch-SDK/Requests/BranchCloseRequest.m" />
<header-file src="src/ios/dependencies/Branch-SDK/Requests/BranchCreditHistoryRequest.h" />
<source-file src="src/ios/dependencies/Branch-SDK/Requests/BranchCreditHistoryRequest.m" />
<header-file src="src/ios/dependencies/Branch-SDK/Requests/BranchInstallRequest.h" />
<source-file src="src/ios/dependencies/Branch-SDK/Requests/BranchInstallRequest.m" />
<header-file src="src/ios/dependencies/Branch-SDK/Requests/BranchLoadRewardsRequest.h" />
<source-file src="src/ios/dependencies/Branch-SDK/Requests/BranchLoadRewardsRequest.m" />
<header-file src="src/ios/dependencies/Branch-SDK/Requests/BranchLogoutRequest.h" />
<source-file src="src/ios/dependencies/Branch-SDK/Requests/BranchLogoutRequest.m" />
<header-file src="src/ios/dependencies/Branch-SDK/Requests/BranchOpenRequest.h" />
<source-file src="src/ios/dependencies/Branch-SDK/Requests/BranchOpenRequest.m" />
<header-file src="src/ios/dependencies/Branch-SDK/Requests/BranchRedeemRewardsRequest.h" />
<source-file src="src/ios/dependencies/Branch-SDK/Requests/BranchRedeemRewardsRequest.m" />
<header-file src="src/ios/dependencies/Branch-SDK/Requests/BranchRegisterViewRequest.h" />
<source-file src="src/ios/dependencies/Branch-SDK/Requests/BranchRegisterViewRequest.m" />
<header-file src="src/ios/dependencies/Branch-SDK/Requests/BranchSetIdentityRequest.h" />
<source-file src="src/ios/dependencies/Branch-SDK/Requests/BranchSetIdentityRequest.m" />
<header-file src="src/ios/dependencies/Branch-SDK/Requests/BranchShortUrlRequest.h" />
<source-file src="src/ios/dependencies/Branch-SDK/Requests/BranchShortUrlRequest.m" />
<header-file src="src/ios/dependencies/Branch-SDK/Requests/BranchShortUrlSyncRequest.h" />
<source-file src="src/ios/dependencies/Branch-SDK/Requests/BranchShortUrlSyncRequest.m" />
<header-file src="src/ios/dependencies/Branch-SDK/Requests/BranchSpotlightUrlRequest.h" />
<source-file src="src/ios/dependencies/Branch-SDK/Requests/BranchSpotlightUrlRequest.m" />
<header-file src="src/ios/dependencies/Branch-SDK/Requests/BranchUserCompletedActionRequest.h" />
<source-file src="src/ios/dependencies/Branch-SDK/Requests/BranchUserCompletedActionRequest.m" />
<header-file src="src/ios/dependencies/Branch-SDK/Requests/PromoViewHandler.h" />

I'm going to assume that the NPMJS version is missing a required library file.

Using the latest from GitHub now allows me to build a project in xcode 8.

@Ziv-Barber
Copy link

For this plugin I found out that it's always better to use the github version of the plugin.

@phanthinh
Copy link

phanthinh commented Nov 6, 2016

similar issue when used "ionic build ios" and have put error message at below

Undefined symbols for architecture i386: "_OBJC_CLASS_$_CSSearchableIndex", referenced from: objc-class-ref in BranchCSSearchableItemAttributeSet.o "_OBJC_CLASS_$_CSSearchableItem", referenced from: objc-class-ref in BranchCSSearchableItemAttributeSet.o "_OBJC_CLASS_$_CSSearchableItemAttributeSet", referenced from: _OBJC_CLASS_$_BranchCSSearchableItemAttributeSet in BranchCSSearchableItemAttributeSet.o "_OBJC_METACLASS_$_CSSearchableItemAttributeSet", referenced from: _OBJC_METACLASS_$_BranchCSSearchableItemAttributeSet in BranchCSSearchableItemAttributeSet.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

@ethanneff
Copy link
Contributor

Hello @phanthinh,

Sorry about the delay. My notification for this repository were triggered off for some reason.

We have a Pull Request in the making for this issue. #231. This Pull Request is still not ready for prod yet, so in the meantime can you please try the following to bypass npm?

# replace the xxxx's with the corresponding values within https://dashboard.branch.io/settings/link
cordova plugin remove io.branch.sdk;
cordova plugin add https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK.git --variable BRANCH_KEY=xxxx --variable URI_SCHEME=xxxx;

Keep in mind, you might have to reinstall your platforms to clear the cache of the bad Branch sdk:

cordova platform remove android;
cordova platform remove ios;
cordova platform add android;
cordova platform add ios;

@ethanneff
Copy link
Contributor

Hello,

If the above solution did not work, we have updated our SDK to fix the NPM issue. All you will have to do is update to the latest Branch SDK:

change xxxx's to the values in your Branch Dashboard

npm install -g cordova;

cordova platform remove ios;
cordova platform remove android;
cordova platform remove browser;

cordova platform add ios;
cordova platform add android;

cordova plugin remove io.branch.sdk;
cordova plugin add branch-cordova-sdk --variable BRANCH_KEY=x --variable URI_SCHEME=xxxx;

Thank you for your patience.

Best

@phanthinh
Copy link

hi @ethanneff

It's still not working. I try many times but saw error message

Undefined symbols for architecture i386: "_OBJC_CLASS_$_CSSearchableIndex", referenced from: objc-class-ref in BranchCSSearchableItemAttributeSet.o "_OBJC_CLASS_$_CSSearchableItem", referenced from: objc-class-ref in BranchCSSearchableItemAttributeSet.o "_OBJC_CLASS_$_CSSearchableItemAttributeSet", referenced from: _OBJC_CLASS_$_BranchCSSearchableItemAttributeSet in BranchCSSearchableItemAttributeSet.o "_OBJC_METACLASS_$_CSSearchableItemAttributeSet", referenced from: _OBJC_METACLASS_$_BranchCSSearchableItemAttributeSet in BranchCSSearchableItemAttributeSet.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Can you help me for this?

@adityasaxena
Copy link

@phanthinh Check #250 if it helps. Not sure how good or bad, but did work for me.

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

7 participants