question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[2.13.0] Invalid `RNReanimated.podspec` file: no implicit conversion of nil into Array.

See original GitHub issue

Description

After upgrading to 2.13.0 it throws the error below. I’ve rm -rf Pods, rm Podfile.lock, pod install and the issue persists.

[!] Invalid `Podfile` file: 
[!] Invalid `RNReanimated.podspec` file: no implicit conversion of nil into Array.

 #  from /Users/stathis/WebstormProjects/xxxxxx/node_modules/react-native-reanimated/RNReanimated.podspec:6
 #  -------------------------------------------
 #  config = find_config()
 >  assert_no_multiple_instances(config)
 #  assert_no_reanimated2_with_new_architecture(reanimated_package_json)
 #  -------------------------------------------
.

 #  from /Users/stathis/WebstormProjects/xxxxx/ios/Podfile:25
 #  -------------------------------------------
 #  target 'xxxx' do
 >    config = use_native_modules!
 #  
 #  -------------------------------------------

full Podfile:

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '12.4'
install! 'cocoapods', :deterministic_uuids => false

IS_CI = ENV['APPCENTER_BUILD_ID']

# Define find-and-replace function
# def find_and_replace(dir, findstr, replacestr)
#  Dir[dir].each do |name|
#      text = File.read(name)
#      replace = text.gsub(findstr,replacestr)
#      replaced = text.index(replacestr)
#      if replaced == nil && text != replace
#          puts "Fix: " + name
#          File.open(name, "w") { |file| file.puts replace }
#          STDOUT.flush
#      end
#  end
#  Dir[dir + '*/'].each(&method(:find_and_replace))
#end

target 'xxxx' do
	config = use_native_modules!

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

	use_react_native!(
		:path => config[:reactNativePath],
		# to enable hermes on iOS, change `false` to `true` and then install pods
		:hermes_enabled => true,
		:fabric_enabled => flags[:fabric_enabled],
		# An absolute path to your application root.
		:app_path => "#{Pod::Config.instance.installation_root}/.."
	)

	permissions_path = '../node_modules/react-native-permissions/ios'

	pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
	pod 'Permission-Microphone', :path => "#{permissions_path}/Microphone"
	pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse"
	pod 'FlipperKit/SKIOSNetworkPlugin', '=' + "0.162.0"


	use_native_modules!

	pod 'react-native-image-crop-tools', :path => '../node_modules/react-native-image-crop-tools'

	# Enables Flipper.
	#
	# Note that if you have use_frameworks! enabled, Flipper will not work and
	# you should disable these next few lines.
	if not IS_CI
		use_flipper!({ 'Flipper' => '0.162.0' })
		pod 'RNLocalize', :path => '../node_modules/react-native-localize'

	end
	post_install do |installer|
		react_native_post_install(installer)
		installer.pods_project.targets.each do |target|

			if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
				target.build_configurations.each do |config|
					config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
				end
			end
		end
		# # to build for the simulator on Apple M1
		# installer.pods_project.targets.each do |target|
		#   target.build_configurations.each do |config|
		#     # disables arm64 builds for the simulator
		#     config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
		#   end
		# end

		#find_and_replace("Pods/RCT-Folly/folly/synchronization/DistributedMutex-inl.h",
		#"atomic_notify_one(state)", "folly::atomic_notify_one(state)")

		#find_and_replace("Pods/RCT-Folly/folly/synchronization/DistributedMutex-inl.h",
		#"atomic_wait_until(&state, previous | data, deadline)", "folly::atomic_wait_until(&state, previous | data, deadline)")

		installer.pods_project.build_configurations.each do |config|
			if config.name == 'Release'
				config.build_settings['SWIFT_COMPILATION_MODE'] = 'wholemodule'
			end
		end
	end
end

Steps to reproduce

  1. Update to 2.13.0
  2. Pod install

Snack or a link to a repository

no snack

Reanimated version

2.13.0

React Native version

0.68.5

Platforms

iOS

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Paper (Old Architecture)

Build type

Debug mode

Device

iOS simulator

Device model

iPhone 13

Acknowledgements

Yes

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
efstathiosntonascommented, Nov 16, 2022

@tomekzaw found the culprit, had nothing to do with reanimated, I had a resolution on package.json pointing to 2.12.0. Damn I hate monorepos and the 100 package.json files. Sorry for the inconvenience.

1reaction
efstathiosntonascommented, Nov 16, 2022

@tomekzaw it throws the same arror.

These are the applied changes:

reanimated_package_json = JSON.parse(File.read(File.join(__dir__, "package.json")))
# config = find_config()
reanimated_config = find_config()
# assert_no_multiple_instances(config)
assert_no_multiple_instances(reanimated_config)
assert_no_reanimated2_with_new_architecture(reanimated_package_json)
Read more comments on GitHub >

github_iconTop Results From Across the Web

IOS: Invalid `Podfile` file: no implicit conversion of nil into String
Any idea what mismatch do I have going on here? I'm not sure I understand the hierarchy of the relationships between node_modules/package.json ...
Read more >
Fixing "Invalid `Podfile` file: no implicit conversion of nil into ...
I tried running integration tests on a my project, and I got this cryptic error:
Read more >
no implicit conversion of nil into String" if host is disassociated
... vm fails with error "TypeError: no implicit conversion of nil into Stri. ... {"id"=>"tower.example.com"} 2019-02-16T14:26:39 [I|app|4c181046] Current ...
Read more >
no implicit conversion of nil into String. ive searched - YouTube
iOS : flutter error Invalid `Podfile` file : no implicit conversion of nil into String. ive searched through discussions but I cant seem...
Read more >
Trying to update custom app via API fails with 'The task failed ...
Here are the steps I tried: Uploaded a file using POST ... 'The task failed because of an error: no implicit conversion of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found