码迷,mamicode.com
首页 > 移动开发 > 详细

iOS导入高德地图出现缺失armv7--"Undefined symbols for architecture armv7"

时间:2017-07-25 01:06:44      阅读:266      评论:0      收藏:0      [点我收藏+]

标签:方式   html   api   原因   www   ase   reference   objc   pod   

在已有项目中使用pod导入高德地图,报了以下错误:

ld: warning: directory not found for option -L/Users/paul/iOS/yun-hui-yi/libs/Release-iphoneos
Undefined symbols for architecture armv7:
  "_OBJC_CLASS_$_MAMapView", referenced from:
      objc-class-ref in SingleLocationViewController.o
  "_OBJC_CLASS_$_MAPointAnnotation", referenced from:
      objc-class-ref in SingleLocationViewController.o
  "_OBJC_CLASS_$_MAPinAnnotationView", referenced from:
      objc-class-ref in SingleLocationViewController.o
  "_OBJC_CLASS_$_AMapLocationManager", referenced from:
      objc-class-ref in SingleLocationViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

首先百度一下,会发现大家遇到这个问题的情况还很多,参考:错误总结:Undefined symbols for architecture

鄙人遇到的问题并不在其列,下面是本人的解决方法:

技术分享

 

这还要归功于pod,接下来分享一下个人解决问题的过程:

首先我导入高德地图的方式是pod自动导入,这种方式很方便.在DOS窗口下键入"pod install"后即可导入任何想要的已有第三方库,(具体使用与安装参考:如何安装/更新ruby,安装cocoapods,为开发做好准备!)

然后,我发现这次的导入并没有打印出往常的成功信息,而是出现了以下内容:

[!] The `CdmaMeeting [Debug]` target overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Target Support Files/Pods-CdmaMeeting/Pods-CdmaMeeting.debug.xcconfig. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The `CdmaMeeting [Release]` target overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Target Support Files/Pods-CdmaMeeting/Pods-CdmaMeeting.release.xcconfig. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

意思是:

[!]`CdmaMeeting [Debug]`目标覆盖Pods/Target Support Files/Pods-CdmaMeeting/Pods-CdmaMeeting.debug.xcconfig中定义的“OTHER_LDFLAGS”构建设置。 这可能会导致CocoaPods安装的问题
     - 使用`$(inherited)标志,或
     - 从目标中删除构建设置。

[!]“CdmaMeeting [Release]”目标覆盖“Pods/Target Support Files/Pods-CdmaMeeting/Pods-CdmaMeeting.release.xcconfig”中定义的“OTHER_LDFLAGS”构建设置。 这可能会导致CocoaPods安装的问题
     - 使用`$(inherited)标志,或
     - 从目标中删除构建设置。

于是,按照以前的习惯,在target中搜索:OTHER_LDFLAGS

在Build setting中搜索到了,也就是上面图中所示.

 

具体什么原因呢?按照以前的做法,pod一般会成功,如果不成功,便是项目中有些设置与pod冲突了,这里便是Other Link Flags冲突了.

 

iOS导入高德地图出现缺失armv7--"Undefined symbols for architecture armv7"

标签:方式   html   api   原因   www   ase   reference   objc   pod   

原文地址:http://www.cnblogs.com/PaulpauL/p/7231714.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!