xcode library not found

后端 未结 12 784
南方客
南方客 2020-12-05 12:43

I\'m getting the following error:

ld: library not found for -lGoogleAnalytics clang: error: linker command failed with exit code 1 (use -v to see in

相关标签:
12条回答
  • 2020-12-05 13:10

    In my case I had a project with lots of entries in "Build Settings > Other Linker Flags"

    I needed to reduce it down to just

      $(inherited)
      -ObjC
    

    Old settings:

    Updated settings:

    0 讨论(0)
  • 2020-12-05 13:11

    If your library file is called libGoogleAnalytics.a you need to put -lGoogleAnalytics so make sure the .a file is named as you'd expect

    0 讨论(0)
  • 2020-12-05 13:12

    You need to set the "linker search paths" of the project (for both Debug and Release builds). If this library was in, say, a sibling directory to the project then you can set it like this:

    $(PROJECT_DIR)/../GoogleAnalytics/lib

    (you want to avoid using an absolute path, instead keep the library directory relative to the project).

    0 讨论(0)
  • 2020-12-05 13:15

    For me it was a silly thing: my mac uploaded the file into iCloud, and that is why Xcode did not find it.

    If you turn off the automatic upload, it wont happen again.

    0 讨论(0)
  • 2020-12-05 13:17

    You can also try to lint with the --use-library option, as cocoapods lint libraries as framework by default since v0.36

    0 讨论(0)
  • 2020-12-05 13:19

    For me, I open the projectname.xcworkspace file and it all works.

    0 讨论(0)
提交回复
热议问题