我在同一个项目中使用React Native MapsReact Native Unity View . 但是,在将React Native Unity View添加到我的项目时,我在添加UnityConfig.xcconfig文件时收到以下错误:

Use of '@import' when modules are disabled

该错误位于我导入GoogleMaps的AppDelegate.m中 . 我在某处读到你可以将 Enable the modules 设置为 Yes ,但这会给我以下错误:

Undefined symbols for architecture arm64: "_OBJC_CLASS_$_GMSServices", referenced from: objc-class-ref in AppDelegate.o

这似乎与AppDelegate.m中的行有关,我在其中添加了Google Maps API密钥:

[GMSServices provideAPIKey:@"MY_KEY"];

所以根据我的理解,链接存在某种问题 . 添加UnityConfig.xcconfig文件时,我的项目不再找到Google Maps框架 . 我对.xcconfig文件不是很熟悉所以我的问题是我缺少什么以及我应该如何设置我的项目 . 我唯一做的是将原始.xcconfig文件导入UnityConfig.xcconfig,否则我收到一条错误消息,说它无法找到我的pod .

#include "Pods/Target Support Files/Pods-MyProject/Pods-MyProject.debug.xcconfig"