Linker command failed with exit code 1 - duplicate

2020-02-08 06:50发布

Since I've updated to Xcode 8.1 I can't archive and also not run in Release mode (in debug mode its working). The error is that there are several "duplicate symbols for architecture arm64" and all are "duplicate symbol __TMRbBp". Whats that?

标签: xcode8.1
13条回答
够拽才男人
2楼-- · 2020-02-08 07:30

I had removed files from Compile Sources in Build Phases in Targets. I added main.m and it worked.

查看更多
趁早两清
3楼-- · 2020-02-08 07:32

Don't double click Project.xcodeproj to start your xcode project. Instead, close your project and open the xcworkspace.

File -> Close Workspace

File -> Open -> Search your project folder for Project.xcworkspace

All my errors are gone.

查看更多
我命由我不由天
4楼-- · 2020-02-08 07:34

1.Close your project:Completely quit Xcode. 2.Go to your project location:there you will find two files in you root folder with varying extensions: Appname.xcodeproj and Appname.xcworkspace

Now open your project by Double clicking on file with the extensions xcworkspace.(***Appname.xcworkspace*)**

Yourproject will open in xcode. Now run your project again.

If you pay close attention when installing your pods,firebase makes it clear to open your project with your-project.xcworkspace after installing pods firebaseIOS Setup

 $ cd your-project directory
 $ pod init

Add to Podfile

pod 'Firebase/Core'

And finally:

    $ pod install
    $ open your-project.xcworkspace

Dont forget to add firebase to your AppDelegate

查看更多
甜甜的少女心
5楼-- · 2020-02-08 07:37

If you're using Ionic and the Push and Console plugins that's the problem. Remove the cordova console plugin (which is deprecated) and the error will disappear.

The linker error is saying that a library is duplicated which is, in fact, true because the console plugin is already in cordova-ios 4.5+

It took me a couple of hours to figure this out!

查看更多
家丑人穷心不美
6楼-- · 2020-02-08 07:37

I ran into this problem recently creating a new project and adding some pods (AlamoFire specifically) to the project. Troubled with it a couple hours or so recreating the project (it was new) several times. Tried all the methods here and no luck.

Eventually I figured out that it was because XCode V10.1 was also opening the old project file along with the new pod-created workspace when I opened the workspace via command line "open myProject.xcworkspace" when I reopened the project after doing "pod install"

Closing all projects before exiting XCode before I did my "pod install" fixed everything for me.

查看更多
再贱就再见
7楼-- · 2020-02-08 07:41

In my case

  1. Select your project (In my case i have 2 targets)
  2. Go to Build Phases
  3. Compile Sources
  4. Check if the number of items on each targets is the same (mine was different)
  5. Add the missing file / Remove the duplicated file

Problem Solved

查看更多
登录 后发表回答