Firebase: Следующие стручки Swift пока не могут быть интегрированы в качестве статических библиотек

Ола-ола,

Я столкнулся со следующей ошибкой после запуска npx pod-install при использовании React Native Firebase(v15.2.0) и React Native v0.69.3:

[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `FirebaseCoreInternal` depends upon `GoogleUtilities`, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.
Войти в полноэкранный режим Выход из полноэкранного режима

После добавления только pod 'GoogleUtilities', :modular_headers => true вышеописанная проблема была решена. Затем у меня возникло множество подобных ошибок с другими модулями RNFirebase, такими как FirebaseStorage, FirebaseFunctions и т.д.

Как делают многие разработчики, я добавил первую строку в Google: The following Swift pods cannot yet be integrated as static libraries: и нашел ответы для библиотек, не относящихся к RNFirebase.

Я не увидел никаких проблем с react-native-firebase, поэтому я обратился к их репозиторию и нашел это сообщение, которое ведет к ответу на StackOverflow…

Для меня вышеупомянутая ошибка была решена путем добавления следующего в мой Podfile, что привело к отсутствию проблем для любого модуля RNFirebase:

  pod 'Firebase', :modular_headers => true
  pod 'FirebaseCore', :modular_headers => true
  pod 'FirebaseCoreInternal', :modular_headers => true  
  pod 'FirebaseStorageInternal', :modular_headers => true
  pod 'FirebaseCoreExtension', :modular_headers => true
  pod 'FirebaseAppCheckInterop', :modular_headers => true
  pod 'FirebaseAuthInterop', :modular_headers => true
  pod 'FirebaseMessagingInterop', :modular_headers => true
  pod 'GTMSessionFetcher', :modular_headers => true
  pod 'FirebaseAppCheckInterop', :modular_headers => true
  pod 'FirebaseAuthInterop', :modular_headers => true
  pod 'GoogleUtilities', :modular_headers => true
Войти в полноэкранный режим Выйти из полноэкранного режима

Надеюсь, это повысит наглядность для других.

-Matt

Оцените статью
devanswers.ru
Добавить комментарий