Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid Podfile file: undefined method `enable_user_defined_build_types!'

Tags:

cocoapods

I have installing gem on a Macbook Pro running Big Sur and M1 chip. I have followed the instructions given, added these two lines on top of my Podfile

plugin 'cocoapods-user-defined-build-types'
enable_user_defined_build_types!

then I am running the command

sudo gem install 'cocoapods-user-defined-build-types'

and gem is getting installed see below -

Successfully installed cocoapods-user-defined-build-types-0.0.7
Parsing documentation for cocoapods-user-defined-build-types-0.0.7
Done installing documentation for cocoapods-user-defined-build-types after 0 seconds
1 gem installed

Now, as soon as I run pod install, I get this error -

[!] Invalid Podfile file: undefined method `enable_user_defined_build_types!' for #<Pod::Podfile:0x0000000145251098 @defined_in_file=#<Pathname

Any idea what excatly is the problem here?

like image 506
Amit Pareek Avatar asked Mar 20 '26 14:03

Amit Pareek


2 Answers

I solved this issue by installing specific version of cocoapods with gem.

Open a terminal in your Xcode project folder and run the commands below:

  1. gem cleanup
  2. brew uninstall cocoapods
  3. sudo gem uninstall cocoapods
  4. sudo gem install cocoapods -v 1.10.0 -n /usr/local/bin
  5. sudo gem install cocoapods-user-defined-build-types
  6. pod install --repo-update

NOTE! If you using react-native before pod install --repo-update delete your node_modules folder and install again using npm

like image 94
iGroza Avatar answered Mar 23 '26 03:03

iGroza


add gem 'cocoapods-user-defined-build-types' to your gemfile and run bundle install

this should work if the other solutions didn't

like image 30
Valn1 Avatar answered Mar 23 '26 04:03

Valn1