> ## Content Index
> Fetch the complete content index at: https://developerinsider.co/llms.txt
> Use this file to discover other available public pages before exploring further.

# Cocoapods remove duplicate symbols for architecture i386 error
- URL: https://developerinsider.co/cocoapods-remove-duplicate-symbols-errors/
- Published: 2016-03-14T15:31:00.000Z
- Updated: 2018-03-29T17:00:49.000Z
- Author: Vineet Choudhary
- Tags: iOS, Cocoapods

When we used two or more 3rd party library in our project using `Cocoapods` then there are possibility of duplicate symbols used by different libraries. In my case, I just added some pod and after nothing works anymore. I get more than 482 duplicate symbols for architecture i386 errors, like this one:

```
duplicate symbol _OBJC_IVAR_$_AFHTTPRequestOperation._responseSerializer in:
/Users/vineetchoudhary/Library/Developer/Xcode/DerivedData/XYZ-emjexnnjljambodthokzwpwcddhz/Build/Products/Debug-iphonesimulator/libPods-AFNetworking.a(AFHTTPRequestOperation.o)
/Users/vineetchoudhary/Library/Developer/Xcode/DerivedData/XYZ-emjexnnjljambodthokzwpwcddhz/Build/Products/Debug-iphonesimulator/libAFNetworking.a(AFHTTPRequestOperation.o)
... (482 times the same error but pointing to different duplicated files)
ld: 482 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

```

#### Reason of this error

The main reason of duplicate symbols error is `const` and `extern` variable used by one library similar to other library.

#### Solution

Best solution to remove the duplicate symbols error is, post\_install [Hook](http://guides.cocoapods.org/syntax/podfile.html?ref=developerinsider.co#group%5Fhooks).

> The Podfile provides hooks that will be called during the installation process. Hooks are global and not stored per target definition.

**post\_install Hook** \- This hook allows you to make any last changes to the generated Xcode project before it is written to disk, or any other tasks you might want to perform. So, to avoid the duplicate symbol I added the `post_install` in the `Podfile`

Add post\_install in your PodFile just after `platform :ios, '8.0'` line, to manually rename all of the symbols

```
platform :ios, '8.0'

post_install do |installer_representation|
installer_representation.project.targets.each do |target|
    target.build_configurations.each do |config|
        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited), PodsDummy_Pods=SomeOtherNamePodsDummy_Pods'
        end
    end
end

```

Delete the following pod item's from your project  
1.Pods Folder  
2.Podfile.lock  
3.ProjectName.xcworkspace

And then install the pods again using `pod install` command.