首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >未知配置白名单:。CocoaPods找到了调试和发布,您的意思是其中之一吗?React Native

未知配置白名单:。CocoaPods找到了调试和发布,您的意思是其中之一吗?React Native
EN

Stack Overflow用户
提问于 2022-11-01 18:19:12
回答 1查看 228关注 0票数 0

我试图在我的反应本地应用程序中做pod install。但它显示了以下错误。

代码语言:javascript
运行
复制
Auto-linking React Native modules for target `<projectname>`: RNScreens, RNVectorIcons, and react-native-safe-area-context
[Codegen] Generating ./build/generated/ios/React-Codegen.podspec.json
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
[Codegen] Found FBReactNativeSpec
/Users/belgin/Documents/Apps/<projectname>/node_modules/react-native/scripts/react_native_pods_utils/script_phases.rb:50: warning: Passing safe_level with the 2nd argument of ERB.new is deprecated. Do not use it, and specify other arguments as keyword arguments.
/Users/belgin/Documents/Apps/<projectname>/node_modules/react-native/scripts/react_native_pods_utils/script_phases.rb:50: warning: Passing trim_mode with the 3rd argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, trim_mode: ...) instead.
Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`
Fetching podspec for `boost` from `../node_modules/react-native/third-party-podspecs/boost.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
[!] Unknown configuration whitelisted: . CocoaPods found debug and release, did you mean one of these?

这开始发生在我升级了我的react本地版本之后。我尝试了以下解决方案

Cocoapods Warning - CocoaPods did not set the base configuration of your project because because your project already has a custom config set

但似乎什么都起不到作用。

我的PodFile

代码语言:javascript
运行
复制
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '11.0'
install! 'cocoapods', :deterministic_uuids => false

target '<ProjectName>' do
  config = use_native_modules!

  # Flags change depending on the env values.
  flags = get_default_flags()

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => flags[:hermes_enabled],
    :fabric_enabled => flags[:fabric_enabled],
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  target '<ProjectName>' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable the next line.
  use_flipper!()

  post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end
end
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-11-02 13:09:21

实际上,在寻找解决方案之后,我做到了这一点,而且成功了。

node_modules/@react-native-community/cli-platform-ios/build/config/index.js

  1. 替换dependencyConfig函数

下的该行let configurations = [];

有以下几行

代码语言:javascript
运行
复制
let configurations = [];
if(userConfig) {
  configurations = userConfig.configurations || [];
}

pod install

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74280201

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档