Skip to content
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

0.3.2版本升级到1.0.4后xCode编译出错 #95

Closed
Yieron opened this issue Sep 3, 2019 · 1 comment
Closed

0.3.2版本升级到1.0.4后xCode编译出错 #95

Yieron opened this issue Sep 3, 2019 · 1 comment
Labels
bug Something isn't working ios Only for ios

Comments

@Yieron
Copy link

Yieron commented Sep 3, 2019

**为了节省大家的时间,请尽可能详细地说明问题,并最好提供截图(特别是出错信息)。**0.3.2版本升级到1.0.4后xCode编译出错,出现很多包的错误,经过一下午的折腾,终于好了,总结下来。
1:react-native link对iOS不起作用。需要手动操作,按照文档
——————————————————————————————————————————
——————————————————————————————————————————
Project navigator ➜ 右击 Libraries ➜ 选择 Add Files to "XXXX"...

选择并添加 node_modules/react-native-amap-geolocation/lib/ios/AMapGeolocation.xcodeproj (或从文件浏览器里将该文件拖拽到 Libraries)

Build Phases ➜ Link Binary With Libraries 中选择并添加 libAMapGeolocation.a

iOS 项目的额外配置
对于 iOS 项目无论如何还要手动下载 SDK 并进行一些必要的配置,也可以参考官方文档: 手动部署。

下载 iOS SDK
从官方网站下载 基础 SDK(含 IDFA) 和 定位 SDK 并解压到 ios/ (注意 *.framework 文件必须放到 ios/ 目录,一定要放到其他目录请自行设置 AMapGeolocation.xcodeproj 的 Search Path)。

将解压得到的 AMapFoundationKit.framework 和 AMapLocationKit.framework 以及 ExternalAccessory.framework 添加到 Build Phases ➜ Link Binary With Libraries。

添加权限申请
在 iOS 项目的 Info.plist 添加定位权限申请。
——————————————————————————————————————————
——————————————————————————————————————————
完成后,把原先podfile中’pod 'react-native-amap-geolocation', path: '../node_modules/react-native-amap-geolocation/lib/ios'‘去掉
image
运行后报错,错误为:clang: error: no such file or directory: '/Users/yindong/ReactNativeProject/wdlj/wdljApp/node_modules/react-native-amap-geolocation/lib/ios/RCTGeolocationModule.m' 这是原先类库的iOS原生交互的Module,将此文件删掉。
image
还有可能遇到library not found 'lreact-native-amagelocation' 或者 ld: library not found for -ljcore-ios。

@Yieron Yieron added bug Something isn't working ios Only for ios labels Sep 3, 2019
@Yieron
Copy link
Author

Yieron commented Sep 3, 2019

如果是升级的就删除原先podfile中的文件
然后删除RCTGeolocationModule.m这个文件。
按照上面的文档就OK了。

--如果一次不成功,多走几次上面的步骤。

@Yieron Yieron closed this as completed Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ios Only for ios
Projects
None yet
Development

No branches or pull requests

1 participant