3
votes

I have a phonegap app with many plugins that runs fine on iOS devices. However, I am currently using $(ARCHS_STANDARD_32_BIT) for architectures in xcode, and now believe I need to update it to be $(ARCHS_STANDARD) in the architecture setting and to include arm64 as a valid architecture per Apple's Feb 1, 2015 requirements.

When I try to run the project on an iPhone 6, I get 16 errors now, copied below. 2 questions:

1) Do I need to use the archs_standard and arm64 changes mentioned in the 1st paragraph?

2) How do I fix these issues so I can submit my app? Is it all issues with individual plugins I'm using? Do I need to find an updated version (or update myself) every plugin listed in the errors or is the issue related to something else? I don't see updates for 64-bit on a few of the plugins I've looked at, so not sure if this is what the issue is. I'm not very familiar with Obj C so appreciate any help here!

Thanks in advance for any help!

Error messages:

Undefined symbols for architecture arm64: "_CDVPageDidLoadNotification", referenced from: -[CDVSplashScreen pluginInitialize] in CDVSplashScreen.o "_OBJC_CLASS_$_CDVInvokedUrlCommand", referenced from: objc-class-ref in CDVFile.o "_OBJC_METACLASS_$_CDVCommandQueue", referenced from: _OBJC_METACLASS_$_MainCommandQueue in MainViewController.o "_OBJC_CLASS_$_CDVPlugin", referenced from: _OBJC_CLASS_$_CDVLocation in CDVLocation.o _OBJC_CLASS_$_FacebookConnectPlugin in FacebookConnectPlugin.o _OBJC_CLASS_$_IonicKeyboard in IonicKeyboard.o _OBJC_CLASS_$_CDVInAppBrowser in CDVInAppBrowser.o _OBJC_CLASS_$_APPEmailComposer in APPEmailComposer.o _OBJC_CLASS_$_CDVStatusBar in CDVStatusBar.o _OBJC_CLASS_$_CDVVibration in CDVVibration.o ... "_OBJC_METACLASS_$_CDVViewController", referenced from: _OBJC_METACLASS_$_MainViewController in MainViewController.o "_CDVLocalNotification", referenced from: -[AppDelegate application:didReceiveLocalNotification:] in AppDelegate.o "_OBJC_CLASS_$_CDVViewController", referenced from: l_OBJC_$_CATEGORY_CDVViewController_$_StatusBar in CDVStatusBar.o _OBJC_CLASS_$_MainViewController in MainViewController.o objc-class-ref in CDVFile.o "_OBJC_METACLASS_$_CDVCommandDelegateImpl", referenced from: _OBJC_METACLASS_$_MainCommandDelegate in MainViewController.o "_OBJC_CLASS_$_CDVWebViewDelegate", referenced from: objc-class-ref in CDVInAppBrowser.o "_OBJC_CLASS_$_CDVCommandQueue", referenced from: _OBJC_CLASS_$_MainCommandQueue in MainViewController.o "_OBJC_CLASS_$_CDVUserAgentUtil", referenced from: objc-class-ref in CDVInAppBrowser.o "_CDVPluginHandleOpenURLNotification", referenced from: -[AppDelegate application:handleOpenURL:] in AppDelegate.o -[CDVInAppBrowser openInSystem:] in CDVInAppBrowser.o "_OBJC_CLASS_$_CDVCommandDelegateImpl", referenced from: _OBJC_CLASS_$_MainCommandDelegate in MainViewController.o "_OBJC_CLASS_$_CDVPluginResult", referenced from: objc-class-ref in CDVLocation.o objc-class-ref in FacebookConnectPlugin.o objc-class-ref in CDVInAppBrowser.o objc-class-ref in APPEmailComposer.o objc-class-ref in CDVStatusBar.o objc-class-ref in CDVLocalFilesystem.o objc-class-ref in PushPlugin.o ... "_OBJC_METACLASS_$_CDVPlugin", referenced from: _OBJC_METACLASS_$_CDVLocation in CDVLocation.o _OBJC_METACLASS_$_FacebookConnectPlugin in FacebookConnectPlugin.o _OBJC_METACLASS_$_IonicKeyboard in IonicKeyboard.o _OBJC_METACLASS_$_CDVInAppBrowser in CDVInAppBrowser.o _OBJC_METACLASS_$_APPEmailComposer in APPEmailComposer.o _OBJC_METACLASS_$_CDVStatusBar in CDVStatusBar.o _OBJC_METACLASS_$_CDVVibration in CDVVibration.o ... ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

2
Is the CDV stuff yours or a plugin? I haven't used phonegap but it looks like it's not been compiled for 64 bit. Did you recompile all your dependent libs? You can't link 32 but libs with the 64 bit project.Blair MacIntyre
Check wether your plugin is 64 bits or not if it doesn't have 64 bits support then you have to get new plugin which supports 64 bits plugin.Shashi3456643
@BlairMacIntyre I believe all the CDV errors are 3rd-party plugins. Any advice on how to change the libraries to 64-bit (keeping in mind I'm not well versed in Obj C)? Thanks for the quick responses btw!manihiki
@Shashi3456643 Do you know how I can tell if the plugin is 64-bit or 32-bit? Thanks for the quick response btw!manihiki
@Blair comment is correct. As you have mentioned when you compile your code it gives 64 bits error for plug in it means your plug in is not 64 bits. If you have source code for plugin put arm64 in build architecture. Go to vendor website from where you downloaded your plugin download the plugin source code or plugin build which supports 64 bits. I had same problem with Dropbox I was using 32 bits but when I needed to submit the app to AppStore I downloaded for 64 bits api from Dropbox and it worked.Shashi3456643

2 Answers

3
votes

1) Do I need to use the archs_standard and arm64 changes mentioned in the 1st paragraph?

Yes, you have to use $(ARCHS_STANDARD) and arm64 if you want to submit the app to the stores.

2) How do I fix these issues so I can submit my app? Is it all issues with individual plugins I'm using? Do I need to find an updated version (or update myself) every plugin listed in the errors or is the issue related to something else? I don't see updates for 64-bit on a few of the plugins I've looked at, so not sure if this is what the issue is. I'm not very familiar with Obj C so appreciate any help here!

The plugins are fine, the problem is the cordovaLib project. You have to change the cordovaLib project to $(ARCHS_STANDARD) too and rebuild the libCordova.a, or even better, use a cordova version greater than 3.4 that will include the 64 bits support.

EDIT: More details from the link manihiki provided:

You will need to update the Build Settings in your project. The steps are mentioned in the issue and reproduced below:

//Update build settings for your project  
Select your Project icon Choose Build Settings.  
For “Architectures”, select $ARCHS_STANDARD – Standard architectures (armv7, armv7s, arm64) 
For “Valid Architectures”, add “arm64″ 

//Update build settings for cordovaLib project 
Select your CordovaLib.xcodeproj icon  
In the Build Settings for the Project (not Target), delete *all* the conditional architecture settings (hover to see the minus sign). This is what is recommended by Apple in their Xcode 5.1 Release Notes.  
For “Architectures”, select $ARCHS_STANDARD – Standard architectures(armv7, armv7s, arm64)  
For “Valid Architectures”, add “arm64″  

//Update build settings for the Target  
In the Build Settings for the Target, delete *all* the conditional architecture settings (hover to see the minus sign).  
For “Architectures”, select $ARCHS_STANDARD – Standard architectures (armv7, armv7s, arm64)  
For “Valid Architectures”, add “arm64″

Some plugins might not work, you have to made this changes On CordovaLib/Classes/CDVCommandQueue.m change this

objc_msgSend(obj, normalSelector, command);

to this

((void (*)(id, SEL, id))objc_msgSend)(obj, normalSelector, command);

and on CordovaLib/Classes/CDVViewController.m

change this

if ((BOOL)objc_msgSend(plugin, selector, request, navigationType) == YES)

to this:

if (((BOOL (*)(id, SEL, id, int))objc_msgSend)(plugin, selector, request, navigationType) == YES)

All the details can be found here https://shazronatadobe.wordpress.com/2014/03/12/xcode-5-1-and-cordova-ios/

0
votes

I inherited a legacy PhoneGap/Cordova app and received many similar errors when changing the Architecture Build Setting to $(ARCHS_STANDARD).

I was able to successfully build after updating (removing and then adding) two PhoneGap plugins (out of nine total), and removing/adding the PhoneGap iOS platform each time. Specifically, the plugins were com.phonegap.plugins.barcodescanner and org.apache.cordova.geolocation. I targeted those two plugins by googling the classnames in the errors and determining which plugins they related to.

To "update" a plugin:

cordova plugin rm com.phonegap.plugins.barcodescanner
cordova plugin add com.phonegap.plugins.barcodescanner

To remove/add the PhoneGap/Cordova ios platform:

cordova platform remove ios
cordova platform add ios