jakobo/expo-community-flipper

Podfile Syntax Error

raybelisle opened this issue · 3 comments

I am trying to get the flipper pod installed in my project which is using Expo 47, just upgraded in the last couple of days.

I am getting an error when building the app about a syntax error in the podfile spec. No idea what could be causing this and not sure how to fix?

The generated podfile is below and this is the error I am getting:

Command `pod install` failed.
└─ Cause: Invalid `Podfile` file: syntax error, unexpected '\n', expecting =>
      end
         ^
.

 #  from //ios/Podfile:33
 #  -------------------------------------------
 #          use_flipper!()
 >        end
 #      
 #  -------------------------------------------
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")

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

platform :ios, podfile_properties['ios.deploymentTarget'] || '13.0'
install! 'cocoapods',
  :deterministic_uuids => false

target 'JobbleQA' do
  use_expo_modules!
  config = use_native_modules!

  use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']

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

  use_react_native!(
    :path => config[:reactNativePath],
    :hermes_enabled => podfile_properties['expo.jsEngine'] == 'hermes',
    :fabric_enabled => flags[:fabric_enabled],
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/..",
# @generated begin expo-community-flipper - expo prebuild (DO NOT MODIFY) sync-eaa63d5375e7930ea096abf972908f639babe2c9

      # Flipper support successfully added via expo config plugin
      # https://www.npmjs.com/package/expo-community-flipper
      if !ENV['FLIPPER_DISABLE']
        use_flipper!()
      end
    
# @generated end expo-community-flipper
    #
    # Uncomment to opt-in to using Flipper
    # Note that if you have use_frameworks! enabled, Flipper will not work
    # :flipper_configuration => !ENV['CI'] ? FlipperConfiguration.enabled : FlipperConfiguration.disabled,
  )

  post_install do |installer|
# @generated begin expo-community-flipper-post-install - expo prebuild (DO NOT MODIFY) sync-616283d65c598f00dc6cc76cb3079af422438f93

      # Flipper support successfully added via expo config plugin
      # https://www.npmjs.com/package/expo-community-flipper
      if !ENV['FLIPPER_DISABLE']
        flipper_post_install(installer)
      end
    
# @generated end expo-community-flipper-post-install
    react_native_post_install(
      installer,
      # Set `mac_catalyst_enabled` to `true` in order to apply patches
      # necessary for Mac Catalyst builds
      :mac_catalyst_enabled => false
    )
    __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

  post_integrate do |installer|
    begin
      expo_patch_react_imports!(installer)
    rescue => e
      Pod::UI.warn e
    end
  end
end

Hi @raybelisle! Make sure you're using 47.x.x of expo-community-flipper as well. The edits to the podfile (specifically the postinstall bit) look like they are from SDK 46.

Hey there,

Not sure if you had the same issue, but I recently ran into the same issue and the result was as dump as easy. I needed to do a prebuild with the --clean flag to regenerate the iOS project. Then the error in the Podfile was gone.
Maybe this helps 🤞

It looks like this is resolved. Let me know if the issue crops back up, and I'll reopen things. In future versions of Expo, you can also use the official build-properties plugin and won't need expo-community-flipper anymore. 🎉