Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17350] iOS: Duplicate symbol linker error when using APS libAPSAnalytics.a

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-10-14T22:08:50.000+0000
Affected Version/sRelease 3.3.0
Fix Version/sRelease 3.4.2, Release 3.5.0, Release 4.0.0
ComponentsiOS
Labelsmodule_analytics
ReporterEduardo Gomez
AssigneePedro Enrique
Created2014-07-21T16:18:41.000+0000
Updated2014-12-02T00:18:59.000+0000

Description

Issue description

The developer's app includes a Ti module that wraps a 3rd-party library that uses the iOS Reachability class. It appears that APSAnalytics also uses the iOS Reachability class. Both the 3rd-party library and the APS system include this class in their respective libraries causing a duplicate symbol error during linking. Below is the error I get when manually building the app:
[TRACE] duplicate symbol _kReachabilityChangedNotification in: 
[TRACE] /Users/gary.fong/development/mfoundry/nextgen/trunk/tistudio/nextgen/MB-Next-Gen-Phone/build/iphone/Classes/APSAnalytics/libAPSAnalytics.a(APSReachability.o) 
[TRACE] /Users/gary.fong/development/mfoundry/nextgen/trunk/tistudio/nextgen/MB-Next-Gen-Phone/modules/iphone/com.mf.paydiant.sdk/1.0/libcom.mf.paydiant.sdk.a(Reachability.o) 
[TRACE] ld: 2 duplicate symbols for architecture armv7 
[TRACE] clang: error: linker command failed with exit code 1 (use -v to see invocation) 

Attachments

FileDateSize
libAPSAnalytics.a2014-09-08T20:41:14.000+00001831812

Comments

  1. Ingo Muschenetz 2014-07-21

    I'm unclear on what's going on here. Are they using Titanium or the APS SDK? The APS SDK is not intended for use with a Titanium application. However, parts of APS are shared between the APS SDK and Titanium.
  2. Marco Cota 2014-07-21

    [~ingo] the issue is that customer is using a 3rd party library that uses the iOS Reachability class and when they try to build the app using the Ti SDK 3.3.0.GA they receive this linker error as it appears that one of our SDK classes (APSAnalytics/libAPSAnalytics.a) extends the same Reachability class.
  3. Sabil Rahim 2014-07-21

    [~mcota] do you know which third party module is running into this issue ? and could give me log which shows what are the duplicate symbols. The libAPSAnalytics.a does extend Reachability class. we might have to namespace the class or as temporary solution strip out those symbols from the third party library using lipo. Thanks Sabil
  4. Sabil Rahim 2014-07-21

    Issue seems to originate due to this line of code being in both places.
        NSString *kReachabilityChangedNotification = @"kNetworkReachabilityChangedNotification";
       
    But i believe this problem would have existed with the previous versions of the TISDK too, since we didn't add anything new into Reachability class. Solution for the third party module is to define it as an extern.
       extern NSString * const *kReachabilityChangedNotification;
       
    But in the long run we should be name spacing this constant to play well with other modules. The same problem could occur with APS SDK if users have iOS Reachability class in their app.
  5. Stephen Feather 2014-09-05

    Well, a couple of things to add. No, it doesn't happen for us on 3.2.3.GA using our module for wrapping comscore. That means this is *new, broken behavior* as far as we are concerned in 3.3.0.GA. Our module code doesn't address the _kReachabilityChangedNotification directly.
       20:40 $ grep -r 'kReachabilityChangedNotification' *
       comScore/headers/CSReachability.h:#define kComScoreReachabilityChangedNotification @"kComScoreNetworkReachabilityChangedNotification"
       Binary file comScore/libcomScore.a matches
       
    Its matched in their headers as
       #define kComScoreReachabilityChangedNotification @"kComScoreNetworkReachabilityChangedNotification"
       
    At this point, we may just have to ship this app with 3.2.3.GA. What doesn't make sense in our case is that there is no way that the reference in the header would be a conflict, so its got to be in their binary which we cannot possibly change.
  6. Pedro Enrique 2014-09-05

    PR: https://github.com/appcelerator/aps_sdk/pull/251
  7. Ingo Muschenetz 2014-09-08

    For those having this issue, please back up the file in SDK Root/iphones/classes/APSAnalytics/libAPSAnalytics.a and replace it with the version attached to this ticket.
  8. Stephen Feather 2014-09-09

    tested on 3.4.x against an ios8-gm build seems to have been resolved. tested on 3.3.0.GA against an ios7.1 build also seems to have been resolved.
  9. Pedro Enrique 2014-09-16

    PR for titanium mobile master: https://github.com/appcelerator/titanium_mobile/pull/6090 3.4.x: https://github.com/appcelerator/titanium_mobile/pull/6092
  10. Ingo Muschenetz 2014-09-16

    Note. This is for 3.4.1...NOT 3.4.0.
  11. Ewan Harris 2014-12-02

    Verified fix on: Mac OSX 10.10.1 Appcelerator Studio, build: 3.4.1.201410281743 Titanium SDK build: 3.5.0.v20141201143204, 3.6.0.v20141201145716 Titanium CLI, build: 3.4.1 Alloy: 1.5.1 Xcode 6.2 beta iPhone 6 Plus (8.1.1) Using the module TiComscore built to the above device using SDK 3.4.0.GA to confirm the fail case. Then built using the listed SDK's, the build passed both times with no errors. Closing ticket.

JSON Source