4

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?

3 Answers3

1

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

1

This is just a workaround, not a fix. In fact, you may have multiple targets with different team IDs.

This post_install script in podfile fixed it. As it seems, setting the own developer team is necessary. Replace Your Team ID with the TeamID of your project.

Adding to what @Pruteanu Alexandru answer

cd ios

pod deintegrate

After changing/adding the code from/to Podfile with this one.

post_install do |installer|
  installer.generated_projects.each do |project|
    project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings["DEVELOPMENT_TEAM"] = "Your Team ID"
         end
    end
  end
end

Your PodFile might look like this:

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
    installer.generated_projects.each do |project|
      project.targets.each do |target|
          target.build_configurations.each do |config|
              config.build_settings["DEVELOPMENT_TEAM"] = "YOUR TEAM ID"
           end
      end
    end
  end

After run this on terminal:

pod install

pod update

cd ..
Lonare
  • 3,581
  • 1
  • 41
  • 45
0

I have the problem when building with eas build -p ios (android is working fine) and couldn't find a solution to do it with expo.dev for Expo 47 and Expo 48. Creating, signing, and distributing the bundle with Xcode worked as a workaround.

Edit: today I've noticed eas build -p ios doesn't break anymore without any changes, I'm on Expo 48, no idea...

Daniel Danielecki
  • 8,508
  • 6
  • 68
  • 94