Ionic-framework: build fails for iOS on Ionic Pro due to duplicate symbol _OBJC_CLASS_$_CDVLogger

Created on 10 Sep 2017  路  8Comments  路  Source: ionic-team/ionic-framework

[x] duplicate symbol _OBJC_CLASS_$_CDVLogger in

CDVLogger.o
libCordova.a(CDVLogger.o)

[x] duplicate symbol _OBJC_METACLASS_$_CDVLogger in

CDVLogger.o
libCordova.a(CDVLogger.o)

[x] ld: 2 duplicate symbols for architecture armv7

the same build worked 10 days ago and today the build does not work more.

Ionic version: (check one with "x")
[ ] 1.x (For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1)
[x] 2.x
[ ] 3.x

I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior:
build iOS on ionic pro

Expected behavior:
build new version in dashboard.ionicjs.com

Steps to reproduce:
Application Id: 5a165360

Running with gitlab-ci-multi-runner 9.1.0 (0118d89)
on Mac OSX Runner (9327ea78)
Using Shell executor...
Running on Ionics-Mac-3.local...
Cloning repository...
Cloning into '/Users/ionic/builds/9327ea78/0/project-1'...
Checking out a0233bad as master...
Skipping Git submodules setup
$ fetch-updates
Checking for build process updates...
$ build-ios
Downloading cached www/ dir...
Successfully downloaded www/ dir...
Installing [email protected]
npm WARN deprecated [email protected]: Use uuid module instead
/usr/local/bin/cordova -> /usr/local/lib/node_modules/cordova/bin/cordova

[33m[!] /Users/ionic/builds/9327ea78/0/project-1/platforms/ios/SchoolAdvisor/Plugins/cordova-plugin-ionic/UNIHTTPClientHelper.m:127:101: values of type 'NSUInteger' should not be used as format arguments; add an explicit cast to 'unsigned long' instead [-Wformat]

[body appendData:[[NSString stringWithFormat:@"Content-Length: %d\r\n\r\n", data.length] dataUsingEncoding:NSUTF8StringEncoding]];
 ^

[!] /Users/ionic/builds/9327ea78/0/project-1/platforms/ios/SchoolAdvisor/Plugins/cordova-plugin-ionic/UNIHTTPClientHelper.m:206:38: 'sendSynchronousRequest:returningResponse:error:' is deprecated: first deprecated in iOS 9.0 - Use [NSURLSession dataTaskWithRequest:completionHandler:] (see NSURLSession.h [-Wdeprecated-declarations]

NSData * data = [NSURLConnection sendSynchronousRequest:requestObj returningResponse:&response error:error];
 ~~ ^~~

> Compiling UNIHTTPRequest.m
> Compiling UNIHTTPRequestWithBody.m
> Compiling UNIRest.m
> Compiling UNIUrlConnection.m

[!] /Users/ionic/builds/9327ea78/0/project-1/platforms/ios/SchoolAdvisor/Plugins/cordova-plugin-ionic/UNIUrlConnection.m:53:43: 'initWithRequest:delegate:startImmediately:' is deprecated: first deprecated in iOS 9.0 - Use NSURLSession (see NSURLSession.h) [-Wdeprecated-declarations]

connection = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:NO];
^

> Compiling UNIBaseRequest.m
> Compiling UNIBodyRequest.m
> Compiling UNISimpleRequest.m
> Compiling UNIHTTPBinaryResponse.m
> Compiling UNIHTTPJsonResponse.m
> Compiling UNIHTTPResponse.m
> Compiling UNIHTTPStringResponse.m
> Compiling UNIJsonNode.m
> Compiling CDVSplashScreen.m
> Compiling CDVViewController+SplashScreen.m
> Compiling CDVStatusBar.m

[!] /Users/ionic/builds/9327ea78/0/project-1/platforms/ios/SchoolAdvisor/Plugins/cordova-plugin-statusbar/CDVStatusBar.m:281:44: 'setStatusBarStyle:' is deprecated: first deprecated in iOS 9.0 - Use -[UIViewController preferredStatusBarStyle] [-Wdeprecated-declarations]

[[UIApplication sharedApplication] setStatusBarStyle:style];
^

[!] /Users/ionic/builds/9327ea78/0/project-1/platforms/ios/SchoolAdvisor/Plugins/cordova-plugin-statusbar/CDVStatusBar.m:378:14: 'setStatusBarHidden:' is deprecated: first deprecated in iOS 9.0 - Use -[UIViewController prefersStatusBarHidden] [-Wdeprecated-declarations]

[app setStatusBarHidden:YES];
 ^

[!] /Users/ionic/builds/9327ea78/0/project-1/platforms/ios/SchoolAdvisor/Plugins/cordova-plugin-statusbar/CDVStatusBar.m:411:14: 'setStatusBarHidden:' is deprecated: first deprecated in iOS 9.0 - Use -[UIViewController prefersStatusBarHidden] [-Wdeprecated-declarations]

[app setStatusBarHidden:NO];
 ^

[!] /Users/ionic/builds/9327ea78/0/project-1/platforms/ios/SchoolAdvisor/Plugins/cordova-plugin-statusbar/CDVStatusBar.m:481:48: 'applicationFrame' is deprecated: first deprecated in iOS 9.0 - Use -[UIScreen bounds] [-Wdeprecated-declarations]

CGRect bounds = [[UIScreen mainScreen] applicationFrame];
 ^

> Compiling IonicKeyboard.m
> Linking SchoolAdvisor

[x] duplicate symbol _OBJC_CLASS_$_CDVLogger in

CDVLogger.o
libCordova.a(CDVLogger.o)

[x] duplicate symbol _OBJC_METACLASS_$_CDVLogger in

CDVLogger.o
libCordova.a(CDVLogger.o)

[x] ld: 2 duplicate symbols for architecture armv7

[x] clang: error: linker command failed with exit code 1 (use -v to see invocation)

> Linking SchoolAdvisor
* ARCHIVE FAILED *

The following build commands failed:
Ld /Users/ionic/Library/Developer/Xcode/DerivedData/SchoolAdvisor-gizbdzbxoankgbdbbfxamesrohfc/Build/Intermediates/ArchiveIntermediates/SchoolAdvisor/IntermediateBuildFilesPath/SchoolAdvisor.build/Release-iphoneos/SchoolAdvisor.build/Objects-normal/armv7/SchoolAdvisor normal armv7
(1 failure)
+-------------+-------------------------+
| Build environment |
+-------------+-------------------------+
| xcode_path | /Applications/Xcode.app |
| gym_version | 2.46.1 |
| sdk | iPhoneOS10.3.sdk |
+-------------+-------------------------+

+-------------------------------------+--------------------------------------+
| Lane Context |
+-------------------------------------+--------------------------------------+
| DEFAULT_PLATFORM | ios |
| PLATFORM_NAME | ios |
| LANE_NAME | ios package_build |
| DOWNLOAD_CERTS_CODESIGNING_IDENTITY | iPhone Distribution: Vadim Kantor |
| | (532YXFZLRD) |
| DOWNLOAD_CERTS_TEAM_ID | 532YXFZLRD |
| DOWNLOAD_CERTS_PROJECT_NAME | SchoolAdvisor |
| DOWNLOAD_CERTS_CERT_PATH | /Users/ionic/builds/9327ea78/0/proj |
| | ect-1/cert_file.p12 |
| DOWNLOAD_CERTS_PROVISIONING_PATH | /Users/ionic/builds/9327ea78/0/proj |
| | ect-1/provision_file.mobileprovisio |
| | n |
+-------------------------------------+--------------------------------------+
+------+------------------------+-------------+
| fastlane summary |
+------+------------------------+-------------+
| Step | Action | Time (in s) |
+------+------------------------+-------------+
| 1 | default_platform | 0 |
| 2 | create_keychain | 0 |
| 3 | download_certs | 0 |
| 4 | import_certificate | 0 |
| 5 | update_project_codesi | 0 |
| | gning | |
| 6 | update_project_provis | 0 |
| | ioning | |
| 7 | shell command | 0 |
| 馃挜 | gym | 50 |
| 9 | shell command | 0 |
| 10 | delete_keychain | 0 |
+------+------------------------+-------------+


[!] Error building the application - see the log above
Running after script...
$ clean-up
Cleaning up files...
Successful clean up
ERROR: Job failed: exit status 1


Most helpful comment

The actual solution (for me at least) was to remove the cordova-plugin-console as noted here,a bit further down the same thread that @BhawaniSingh mentions:

https://github.com/ionic-team/ionic/issues/12849#issuecomment-331105393

All 8 comments

Facing same issue.

duplicate symbol _OBJC_CLASS_$_CDVLogger in:
    /Users/dhavalsoni/Library/Developer/Xcode/DerivedData/myProj-clzckrqggoyxvzfaxuwqlbatkprj/Build/Intermediates/myProj.build/Debug-iphoneos/myProj.build/Objects-normal/arm64/CDVLogger.o
    /Users/dhavalsoni/Library/Developer/Xcode/DerivedData/myProj-clzckrqggoyxvzfaxuwqlbatkprj/Build/Products/Debug-iphoneos/libCordova.a(CDVLogger.o)
duplicate symbol _OBJC_METACLASS_$_CDVLogger in:
    /Users/dhavalsoni/Library/Developer/Xcode/DerivedData/myProj-clzckrqggoyxvzfaxuwqlbatkprj/Build/Intermediates/myProj.build/Debug-iphoneos/myProj.build/Objects-normal/arm64/CDVLogger.o
    /Users/dhavalsoni/Library/Developer/Xcode/DerivedData/myProj-clzckrqggoyxvzfaxuwqlbatkprj/Build/Products/Debug-iphoneos/libCordova.a(CDVLogger.o)
ld: 2 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Hello! Thank you for opening an issue with us! I am closing this issue because it is a duplicate of Issue #12849 as already mentioned. Thank you for using Ionic

The actual solution (for me at least) was to remove the cordova-plugin-console as noted here,a bit further down the same thread that @BhawaniSingh mentions:

https://github.com/ionic-team/ionic/issues/12849#issuecomment-331105393

Thanks a lot @paqogomez

got this solution after spending two days of resolving this build issue. THANKS

@paqogomez YES! Thank you! Finally after much troubleshooting and many issues I built successfully

Notes for my iOS build with push plugins to succeed

  • Downgrade phonegap-plugin-push (I was using version 2.2.2)
  • Missing library GoogleToolBox and other library issues. Install CocoaPods

    • cd platform/ios; pod setup; pod repo update; pod install;

    • If you are getting hung up on the dependency process, download/update git to the most recent version. I updated from 2.15.4 to 2.17.0 and that resolved this issue

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Was this page helpful?
0 / 5 - 0 ratings