Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Expo - React Native Build Failed (Starting from Xcode 14, resource bundles are signed by default....)

I'm trying to update an application built with expo + react native and I encounter the last problem.

expo.dev enter image description here

Visual Code terminal

🍎 iOS build failed:
Starting from Xcode 14, resource bundles are signed by default, which requires 
setting the development team for each resource bundle target.
To resolve this issue, downgrade to an older Xcode version using the "image" field in 
eas.json, or turn off signing resource bundles in your Podfile: 
https://expo.fyi/r/disable-bundle-resource-signing
Learn more: https://docs.expo.dev/build-reference/infrastructure/#ios-build-server- 
configurations

I tried to solve this problem by cleaning cache and reinstalling all pods. I went to the permissions in xcode, I tried logging in with an apple developer account but still the same.

I tried to see the changes in this link https://expo.fyi/r/disable-bundle-resource-signing but it is very different from mine, I made the changes but all app is broken when i try to build.

Expo Version: 43.00

cocoapods: "1.11.2"

eas cli version: ">= 0.38.1"

xCode Version: 13.2.1

Podfile

require File.join(File.dirname(`node --print 
"require.resolve('expo/package.json')"`), "scripts/autolinking")
require File.join(File.dirname(`node --print "require.resolve('react- 
native/package.json')"`), "scripts/react_native_pods")
require File.join(File.dirname(`node --print "require.resolve('@react-native- 
community/cli-platform-ios/package.json')"`), "native_modules")

platform :ios, '12.0'

require 'json'
podfile_properties = JSON.parse(File.read('./Podfile.properties.json')) rescue {}

target 'appName' do
  use_expo_modules!
 config = use_native_modules!

use_react_native!(
:path => config[:reactNativePath],
:hermes_enabled => podfile_properties['expo.jsEngine'] == 'hermes'
)

# Uncomment to opt-in to using Flipper
#
# if !ENV['CI']
#   use_flipper!('Flipper' => '0.75.1', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' 
=> '1.3.1')
# end

 post_install do |installer|
react_native_post_install(installer)

# Workaround `Cycle inside FBReactNativeSpec` error for react-native 0.64
# Reference: https://github.com/software-mansion/react-native-screens/issues/842#issuecomment-812543933
installer.pods_project.targets.each do |target|
  if (target.name&.eql?('FBReactNativeSpec'))
    target.build_phases.each do |build_phase|
      if (build_phase.respond_to?(:name) && build_phase.name.eql?('[CP-User] Generate Specs'))
        target.build_phases.move(build_phase, 0)
      end
    end
  end
end
end

end

How can i solve this problem in may case?

like image 321
Pruteanu Alexandru Avatar asked Sep 20 '25 13:09

Pruteanu Alexandru


1 Answers

To solve the problem, follow these steps: In terminal:

cd ios

pod deintegrate

After changing the code from Podfile with this one.

require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
require File.join(File.dirname(`node --print "require.resolve('react- native/package.json')"`), "scripts/react_native_pods")
require File.join(File.dirname(`node --print "require.resolve('@react-native-community/cli-platform-ios/package.json')"`), "native_modules")

platform :ios, '12.0'

require 'json'
podfile_properties = JSON.parse(File.read('./Podfile.properties.json')) 
rescue {}

target 'YOUR APP NAME' do
use_expo_modules!
config = use_native_modules!

use_react_native!(
  :path => config[:reactNativePath],
  :hermes_enabled => podfile_properties['expo.jsEngine'] == 'hermes'
)

# Uncomment to opt-in to using Flipper
#
# if !ENV['CI']
#   use_flipper!('Flipper' => '0.75.1', 'Flipper-Folly' => '2.5.3', 
 'Flipper-RSocket' => '1.3.1')
# end


post_install do |installer|
  react_native_post_install(installer)
  # __apply_Xcode_12_5_M1_post_install_workaround(installer)

  # This is necessary for Xcode 14, because it signs resource bundles by default
  # when building for devices.
  installer.target_installation_results.pod_target_installation_results
    .each do |pod_name, target_installation_result|
    target_installation_result.resource_bundle_targets.each do |resource_bundle_target|
      resource_bundle_target.build_configurations.each do |config|
        config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
      end
    end
   end
 end
end

After run on terminal:

pod install

pod update

cd ..

These changes worked for me and allowed me to adapt the application

like image 150
Pruteanu Alexandru Avatar answered Sep 22 '25 10:09

Pruteanu Alexandru