Cocoapods: Project not building under Xcode 12 beta 6

Created on 15 Sep 2020  Â·  21Comments  Â·  Source: CocoaPods/CocoaPods

Report

What did you do?

After running pod install with cocoapods 1.9.3 and running xcode 12 beta 6, I get a slew of modulemap and briding-header errors. Have tried upgrading cocoapods to 1.10.0.beta.2 and removing FBSDKCoreKit. At that point i get an error on ReactiveSwift.modulemap

Errors:

module map file '/Users/[user]/Library/Developer/Xcode/DerivedData/main-cuvgmbvbxqfobwffdgbyvukrgesw/Build/Products/Debug-iphonesimulator/FBSDKCoreKit/FBSDKCoreKit.modulemap' not found

failed to emit precompiled header '/Users/[user]/Library/Developer/Xcode/DerivedData/main-cuvgmbvbxqfobwffdgbyvukrgesw/Build/Intermediates.noindex/PrecompiledHeaders/[Project]-Bridging-Header-swift_2KJBMP344ZCM1-clang_CFAMZRD1A16S.pch' for bridging header '/Users/[user]/Developer/nfl-rn/packages/apps/[Project]/ios/[Project]-Bridging-Header.h
  1. pod install
  2. build app in debug

What did you expect to happen?

expect pods to install correctly and my build to compile.

What happened instead?

Received Errors:

module map file '/Users/[user]/Library/Developer/Xcode/DerivedData/main-cuvgmbvbxqfobwffdgbyvukrgesw/Build/Products/Debug-iphonesimulator/FBSDKCoreKit/FBSDKCoreKit.modulemap' not found

failed to emit precompiled header '/Users/[user]/Library/Developer/Xcode/DerivedData/main-cuvgmbvbxqfobwffdgbyvukrgesw/Build/Intermediates.noindex/PrecompiledHeaders/[Project]-Bridging-Header-swift_2KJBMP344ZCM1-clang_CFAMZRD1A16S.pch' for bridging header '/Users/[user]/Developer/nfl-rn/packages/apps/[Project]/ios/[Project]-Bridging-Header.h

CocoaPods Environment

Stack

   CocoaPods : 1.10.0.beta.2
        Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin18]
    RubyGems : 3.0.4
        Host : Mac OS X 10.15.4 (19E287)
       Xcode : 12.0 (12A8189n)
         Git : git version 2.24.3 (Apple Git-128)
Ruby lib dir : /Users/joon.son/.rvm/rubies/ruby-2.6.3/lib
Repositories : master - git - https://github.com/CocoaPods/Specs.git @ a9e9a89b58a8565fc99175148f4ad5751c641d2e

               trunk - CDN - https://cdn.cocoapods.org/

Installation Source

Executable Path: /Users/joon.son/.rvm/gems/ruby-2.6.3/bin/pod

Plugins

cocoapods-deintegrate : 1.0.4
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.1.0
cocoapods-trunk       : 1.5.0
cocoapods-try         : 1.2.0
slather               : 2.5.0

Podfile

# frozen_string_literal: true

# Specifies the installation method and options to be used when CocoaPods installs this Podfile
source 'https://github.com/CocoaPods/Specs.git'

ENV['COCOAPODS_DISABLE_STATS'] = 'true'

install! 'cocoapods', deterministic_uuids: false

platform :ios, '11.0'
workspace 'main'

pod 'SwiftLint', '0.39.2'
$npm_path = '../../node_modules'
require_relative "#{$npm_path}/react-native/scripts/react_native_pods"
# require_relative "#{$npm_path}/@react-native-community/cli-platform-ios/native_modules"

def flipper_pods
  flipperkit_version = '0.52.1'
  pod 'FlipperKit',                                     '~>' + flipperkit_version, configuration: 'Debug'
  pod 'FlipperKit/FlipperKitLayoutPlugin',              '~>' + flipperkit_version, configuration: 'Debug'
  pod 'FlipperKit/SKIOSNetworkPlugin',                  '~>' + flipperkit_version, configuration: 'Debug'
  pod 'FlipperKit/FlipperKitUserDefaultsPlugin',        '~>' + flipperkit_version, configuration: 'Debug'
  pod 'FlipperKit/FlipperKitReactPlugin',               '~>' + flipperkit_version, configuration: 'Debug'
  pod 'FlipperKit/FlipperKitLayoutComponentKitSupport', '~>' + flipperkit_version, configuration: 'Debug'

  pod 'react-native-flipper',                    path: "#{$npm_path}/react-native-flipper", configuration: 'Debug'
  pod 'flipper-plugin-react-native-performance', path: "#{$npm_path}/flipper-plugin-react-native-performance/ios", configuration: 'Debug'
end

def onesignal_pod
  pod 'react-native-onesignal',           path: "#{$npm_path}/react-native-onesignal"
end

def appcenter_pods
  pod 'appcenter-core',                   path: "#{$npm_path}/appcenter/ios"
  pod 'appcenter-analytics',              path: "#{$npm_path}/appcenter-analytics/ios"

  pod 'AppCenterReactNativeShared',       '3.1.0'
  pod 'AppCenter',                        '3.3.1', subspecs: %w[Core Analytics Distribute]
end

def reactnative_core_only_pods
  pod 'React-Core',                       path: "#{$npm_path}/react-native"
  pod 'React-CoreModules',                path: "#{$npm_path}/react-native/React/CoreModules"
  pod 'React-cxxreact',                   path: "#{$npm_path}/react-native/ReactCommon/cxxreact"
  pod 'React',                            path: "#{$npm_path}/react-native"
  pod 'Yoga',                             path: "#{$npm_path}/react-native/ReactCommon/yoga"
end

def reactnative_pods
  use_react_native!(path: "#{$npm_path}/react-native")
end

def reactnative_extra_pods
  pod 'BVLinearGradient',                 path: "#{$npm_path}/react-native-linear-gradient"
  pod 'react-native-add-calendar-event',  path: "#{$npm_path}/react-native-add-calendar-event"
  pod 'react-native-advertising-id',      path: "#{$npm_path}/react-native-advertising-id"
  pod 'react-native-appearance',          path: "#{$npm_path}/react-native-appearance"
  pod 'react-native-geolocation',         path: "#{$npm_path}/@react-native-community/geolocation"
  pod 'react-native-in-app-utils',        path: "#{$npm_path}/@nfl/react-native-in-app-utils"
  pod 'react-native-netinfo',             path: "#{$npm_path}/@react-native-community/netinfo"
  pod 'react-native-restart',             path: "#{$npm_path}/react-native-restart"
  pod 'react-native-orientation-locker',  path: "#{$npm_path}/react-native-orientation-locker"
  pod 'react-native-safe-area-context',   path: "#{$npm_path}/react-native-safe-area-context"
  pod 'react-native-splash-screen',       path: "#{$npm_path}/react-native-splash-screen"
  pod 'react-native-video',               path: "#{$npm_path}/react-native-video"
  pod 'react-native-webview',             path: "#{$npm_path}/react-native-webview"
  pod 'RNCAsyncStorage',                  path: "#{$npm_path}/@react-native-community/async-storage"
  pod 'RNCMaskedView',                    path: "#{$npm_path}/@react-native-community/masked-view"
  pod 'RNCPicker',                        path: "#{$npm_path}/@react-native-community/picker"
  pod 'RNDateTimePicker',                 path: "#{$npm_path}/@react-native-community/datetimepicker"
  pod 'RNDeviceInfo',                     path: "#{$npm_path}/react-native-device-info"
  pod 'RNFastImage',                      path: "#{$npm_path}/react-native-fast-image"
  pod 'RNGestureHandler',                 path: "#{$npm_path}/react-native-gesture-handler"
  pod 'RNRate',                           path: "#{$npm_path}/react-native-rate"
  pod 'RNReanimated',                     path: "#{$npm_path}/react-native-reanimated"
  pod 'RNScreens',                        path: "#{$npm_path}/react-native-screens"
  pod 'RNSVG',                            path: "#{$npm_path}/react-native-svg"
  pod 'RNVectorIcons',                    path: "#{$npm_path}/react-native-vector-icons"
  pod 'react-native-safe-area-context',   path: "#{$npm_path}/react-native-safe-area-context"
end

def third_party_pods
  pod 'AdobeMobileSDK',                   '4.19.2'
  pod 'Google-Mobile-Ads-SDK',            '7.64.0'
  pod 'GoogleSignIn',                     '5.0.2'
  pod 'FBSDKCoreKit',                     '7.1.1'
  pod 'FBSDKLoginKit',                    '7.1.1'
  flipper_pods
end

def util_pods
  pod 'ReactiveSwift',                    '6.3.0'
end

def firebase_pods
  pod 'RNFBAnalytics',                    path: "#{$npm_path}/@react-native-firebase/analytics"
  pod 'RNFBApp',                          path: "#{$npm_path}/@react-native-firebase/app"
  pod 'RNFBCrashlytics',                  path: "#{$npm_path}/@react-native-firebase/crashlytics"
  pod 'RNFBPerf',                         path: "#{$npm_path}/@react-native-firebase/perf"
end

def video_pods
  pod 'AdobeMediaSDK',                    '2.2.4'
  pod 'ComScore',                         '6.3.2'
  pod 'ConvivaSDK',                       '2.141.2'
  pod 'GoogleAds-IMA-iOS-SDK',            '3.8.1'
end

# [Project]
target '[Project]' do
  project '[Project]/ios/[Project].xcodeproj'
  appcenter_pods
  firebase_pods
  onesignal_pod
  reactnative_extra_pods
  reactnative_pods
  third_party_pods
  util_pods
  video_pods
  pod 'lottie-ios',                         path: "#{$npm_path}/lottie-ios"
  pod 'lottie-react-native',                path: "#{$npm_path}/lottie-react-native"
  pod 'RNSha256',                           path: "#{$npm_path}/react-native-sha256"

  target '[Project]Tests' do
    inherit! :search_paths
  end
end

target 'Shared' do
  use_frameworks!
  project 'shared/ios/Shared.xcodeproj'
  util_pods

  target 'SharedTests' do
    inherit! :search_paths
    # Pods for testing
    pod 'Quick',    '~> 1.2.0'
    pod 'Nimble',   '~> 7.0.3'
  end
end

# Post Install processing for Flipper
def flipper_post_install(installer)
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      cflags = (config.build_settings['OTHER_CFLAGS'] || '$(inherited) ').dup
      unless cflags.include? '-DFB_SONARKIT_ENABLED=1'
        cflags << '-DFB_SONARKIT_ENABLED=1' if config.name == 'Debug'
      end
      config.build_settings['OTHER_CFLAGS'] = cflags
    end
  end
end

# Having to add this post_install script because appcenter libraries DO NOT
# include 'React' as a dependency in their podspec files, which is a bug.
# More info: https://github.com/Microsoft/AppCenter-SDK-React-Native/pull/326
post_install do |installer|
  flipper_post_install(installer)

  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'NO'
    end
  end
end

Project that demonstrates the issue

ℹ Please link to a project we can download that reproduces the issue.
You can delete this section if your issue is unrelated to build problems,
i.e. it's only an issue with CocoaPods the tool.

help wanted need sample

Most helpful comment

Hi everyone. I faced the same issue today. But was able to resolve it at my end.
One observation: This issue only appears when building for the Simulator, building for device works fine.

The solution to my problem I found on SO: https://stackoverflow.com/a/63405201/11528181
Apparently, CocoaPods (?) sets a user-defined variable VALID_ARCHS that somehow leads to Pods not being built in the correct build order, i.e. before the project that incorporates them.

Deleting the VALID_ARCHS user defined var from my project solved that problem for me. Hopefully it helps others as well.

All 21 comments

This is very hard to diagnose, despite it being a rather thorough error report.

Can you please attach a sample app _without_ ReactNative and as small as possible for us to be able to diagnose?

I have the same problem, is there any update @frankenthumbs ?

I have the same problem, is there any update @frankenthumbs ?

Not yet. I think a lot of people are having build issues with Xcode 12 still.

@dnkoutso thanks for the reply. still trying to figure out what's going on. I have react-native projects in the same workspace that are building. I deleted a notification extension that the problem project had but still getting same build issues.

Thinking it's some rogue Xcode setting.

Thanks for the update @frankenthumbs. We want to eliminate as many variables as possible and distill the issue down to a simple case for us to diagnose and reproduce. We very often see a variety of issues due to ReactNative or Flutter integration.

Hi everyone. I faced the same issue today. But was able to resolve it at my end.
One observation: This issue only appears when building for the Simulator, building for device works fine.

The solution to my problem I found on SO: https://stackoverflow.com/a/63405201/11528181
Apparently, CocoaPods (?) sets a user-defined variable VALID_ARCHS that somehow leads to Pods not being built in the correct build order, i.e. before the project that incorporates them.

Deleting the VALID_ARCHS user defined var from my project solved that problem for me. Hopefully it helps others as well.

@stschwar yup that worked! thank you so much!
for others i had this script for stripping out dynamically linked libraries. guessing that was what's reading the user-defined var.

https://gist.github.com/artemch/9cd6a467ad1177a73d08e55f8ed789e4

The solution to my problem I found on SO: https://stackoverflow.com/a/63405201/11528181
Apparently, CocoaPods (?) sets a user-defined variable VALID_ARCHS that somehow leads to Pods not being built in the correct build order, i.e. before the project that incorporates them.

To be clear VALID_ARCHS is an Xcode thing and with Xcode 12 it was replaced with EXCLUDED_ARCHS.

From Xcode 12 release notes:

The Build Settings editor no longer includes the Valid Architectures build setting (VALID_ARCHS), and its use is discouraged. Instead, there is a new Excluded Architectures build setting (EXCLUDED_ARCHS). If a project includes VALID_ARCHS, the setting is displayed in the User-Defined section of the Build Settings editor. (15145028)

So this is why with Xcode 12 you see VALID_ARCHS in the User-Defined section.

@stschwar that worked! Thank you so much!

I don't have any VALID_ARCHS here. There are nothing set for EXCLUDED_ARCHS!
Still it can't find some pods and won't compile it at all... its a huge issue for most because this is the final release of Xcode 12, its not on beta anymore. Pods won't compile and you can't run it on a simulator.

some folks used this command

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings[‘EXCLUDED_ARCHS[sdk=iphonesimulator*]’] = ‘arm64’
end
end
end

without any success here. issues with Realm Swift and EmptyStateKit during compilation.

Every pod update add a line to the pods xcconfig file:
VALID_ARCHS = arm64 arm64e armv7 armv7s

When we remove it, the project compile fine but it come back every pod update... a real pain
The project need a clean build folder in Xcode to compile when the line is removed.

Rolled back to Xcode 11 fixed this, would like to use latest though...

add x86_64 to VALID_ARCH if need to run app on simulator, e.g., x86_64 arm64 arm64e

@bitmess worked for me.

@bitmess worked for me too thanks you are a life saver

sigh thank you so much @bitmess, you saved me probably tons others much headache.

add x86_64 to VALID_ARCH if need to run app on simulator, e.g., x86_64 arm64 arm64e

for me this didn't worked on Xcode 12.2 beta 2.
what really worked was ONLY_ACTIVE_ARCH = YES;
on both project and pods.

https://developer.apple.com/forums/thread/656509

@bitmess worked for me.

just update the method mention above, all of those didn't work for me after Nov 15, with XCode12 (not beta).
and I try use EXCLUDE_ARCH or other method found in SO, didn't work too, also raise other error (e.g. ARCHS[@]: unbound variable Command PhaseScriptExecution failed with a nonzero exit code)
eventually, I just update CocoaPods to 1.10.0, and delete VALID_ARCHS in my Target's User-Custom section, just leave new default field Architectures with it's default value, and DONE! it's OK !!!
Maybe new CocoaPods version fix this issue, and just remove the old VALID_ARCHS from old project version.

hope help for someone try many method like me :)

@takeTrace That worked

Hi everyone. I faced the same issue today. But was able to resolve it at my end.
One observation: This issue only appears when building for the Simulator, building for device works fine.

The solution to my problem I found on SO: https://stackoverflow.com/a/63405201/11528181
Apparently, CocoaPods (?) sets a user-defined variable VALID_ARCHS that somehow leads to Pods not being built in the correct build order, i.e. before the project that incorporates them.

Deleting the VALID_ARCHS user defined var from my project solved that problem for me. Hopefully it helps others as well.

Thank you so much.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Mingmingmew picture Mingmingmew  Â·  3Comments

steffendsommer picture steffendsommer  Â·  3Comments

sonu5 picture sonu5  Â·  3Comments

soleares picture soleares  Â·  3Comments

pallaviMN picture pallaviMN  Â·  3Comments