Skip to content

duplicate symbol _OBJC_IVAR_$_SSZipArchive._zip in: #241

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

Closed
chirag04 opened this issue Mar 11, 2016 · 15 comments
Closed

duplicate symbol _OBJC_IVAR_$_SSZipArchive._zip in: #241

chirag04 opened this issue Mar 11, 2016 · 15 comments

Comments

@chirag04
Copy link

I get the above issue when configuring codepush. We are also using https://github.com/plrthink/react-native-zip-archive which also rely on SSZipArchive.

cc @lostintangent

@geof90
Copy link
Contributor

geof90 commented Mar 12, 2016

Hi @chirag04 (and anyone else who could be hitting this issue),

The full workaround is to

  1. Delete SSZipArchive from the CodePush library project
    screen shot 2016-03-11 at 6 22 53 pm
  2. Update the Header Search Paths of the CodePush library project to point at the version of SSZipArchive that is bundled together with the react-native-zip-archive plugin.
    screen shot 2016-03-11 at 6 24 21 pm

Closing this, feel free to reopen if this does not work for you.

@chirag04
Copy link
Author

@geof90 well this work but everytime i npm install i would need to delete the folder and set the path again. Can we do one time setup?

@geof90
Copy link
Contributor

geof90 commented May 17, 2016

@chirag04 Sorry for the late reply, I somehow missed this. The best way I see to prevent having the manual deletion step is to make a fork of our project, delete the folder in that fork, and then specify your fork's github URL as a dependency in your package.json.

@cancan101
Copy link

cancan101 commented May 25, 2016

This solution seems less than ideal. Why does this project need to vendor SSZipArchive? Is there no way to handle this dependency in a smarter fashion that does not conflict with other npm packages?

ie some equivalent of NoZip.

@lostintangent
Copy link
Member

@cancan101 It's definitely non-ideal. Unfortunately, react-native-zip-archive also bundles a copy of SSZipArchive with it, so we couldn't easily share a common dependency from CocoaPods/etc. with that package, if both it and CodePush were installed.

Which NPM package is creating the conflict for you? Are you also trying to use react-native-zip-archive? I'll give some thought to this issue today since I agree it needs to be addressed.

@cancan101
Copy link

Yes, am trying to use react-native-zip-archive and I do see they are vendoring as well. I suppose you are both doing so to solve the problem of dependency management in the case where the user is not using Cocoapods.

The reason that I don't want to install react-native-code-push using cocoapods is the requirement to then install RN using cocoapods which I do not want to do.

@plrthink
Copy link

plrthink commented Nov 16, 2016

I'm the author of react-native-zip-archive. I'm also facing this problem today since we are integrating CodePush to our own app.

Honestly, I'm not familiar with native development and I don't know how cocoapod solve this dependency so is there anything I can do with that? I'm so willing to fix this with codepush team.

@itinance
Copy link

From the codepush-docs:

CodePush depends on an internal copy of the SSZipArchive library, so if your project already includes it (either directly or via a transitive dependency), then you can install a version of CodePush which excludes it by depending specifically on the Core subspec:

pod 'CodePush', :path => './node_modules/react-native-code-push', :subspecs => ['Core']
NOTE: The above paths needs to be relative to your app’s Podfile, so adjust it as nec cessary.

Have you tried this out?

@plrthink
Copy link

plrthink commented Nov 16, 2016

@itinance I haven't tried that approach yet. But I think not every rn users use cocoapod, so I still want to try some other solutions.

My colleague told me that since the linker in xcode identifies code by its class names so I changed the class name of SSZipArchive to RNSSZipArchive and this solved the problem. But it still not a perfect way to do that.

If any user is facing the same issue then you can install react-native-zip-archive via github with custom-ssziparchive branch now.

Still trying to find a better solution...

@RoosterKelly
Copy link

@geof90 This is still a significant problem. Is there yet a good solution that does not require constant management of this package just so it does not conflict with other react native modules?
Solutions found so far:

Delete the SSZipArchive and update the search path, which gets overwritten on ever npm install

Create fork, do your own builds. When keep track of updates to parent get and merge changes any time you need them.

Both solutions incur significant cost on any team that runs into this issue.

@plrthink Have you had any success on finding a work around on your end?

@plrthink
Copy link

plrthink commented Jun 9, 2017

@RoosterKelly I have just pushed the next branch which should fix this issue. You can install it via "react-native-zip-archive": "mockingbot/react-native-zip-archive#next" to test it out. If it works on your side, I would publish a version to npm ASAP

@plrthink
Copy link

For folks still use some workarounds to solve this issue, please update react-native-zip-archive to v2 which would fix this out of the box.

@peacechen
Copy link

I upgraded my project to RN 0.56 and CodePush 5.4.0. The build blew up complaining of duplicate symbol errors for Base64, JWT and SSZipArchive. itinance's suggestion of subspecs => ['Core'] for the CodePush pod fixed the problem.

My app isn't using react-native-zip-archive so I'm not sure what's pulling that in. Maybe because CodePush.xcodeproj is included under the project's Libraries?

@VrajSolanki
Copy link

@geof90 @chirag04
I tried remove the SSZIPArchive folder and added custom branch custom-ssziparchive from react-native-zip-archive as suggested by @plrthink.
But now codePush.a linking fails with the error:

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_RNSSZipArchive", referenced from:
      objc-class-ref in libCodePush.a(CodePushPackage.o)
ld: symbol(s) not found for architecture x86_64

can you please suggest something here ?

@plrthink
Copy link

plrthink commented Dec 5, 2019

@VrajSolanki If your react native is above version 60 you can simply use the latest version of there two libraries which would solve the problem automatically.

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

9 participants