cocoapods-user-defined-build-types icon indicating copy to clipboard operation
cocoapods-user-defined-build-types copied to clipboard

Invalid `Podfile` file: undefined method `enable_user_defined_build_types!'

Open amitprk13 opened this issue 3 years ago • 11 comments

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

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

then I am running 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

amitprk13 avatar Jun 13 '21 12:06 amitprk13

I am facing the same issue

yeasitech avatar Jun 15 '21 08:06 yeasitech

@yeasitech I have tried everything downgrading from 1.10.1 to 1.8.3 and between 1.9.0 but nothing works.

amitprk13 avatar Jun 15 '21 11:06 amitprk13

same issure:
pod install

Error: [!] Invalid Podfile file: undefined method `enable_user_defined_build_types!'

liz123cn avatar Jun 23 '21 05:06 liz123cn

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

iGroza avatar Jul 12 '21 07:07 iGroza

React requires CocoaPods version >= 1.10.1, which is not satisfied by your current version, 1.10.0.

nethergrim avatar Oct 05 '21 12:10 nethergrim

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

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

then I am running 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

after install the gem, and open new tab, I can pod install without the error in the new tab

penghouho avatar Nov 17 '21 05:11 penghouho

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

Works like a charm. Tried with cocoapods 1.11.0

Puneet-Chicmic avatar Sep 01 '22 06:09 Puneet-Chicmic

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

This doesn't work for me :( Tried with cocoapods 1.10.0, 1.11.0, 1.11.3 Macbook Pro Intel

fleuverouge avatar Dec 08 '22 09:12 fleuverouge

You might have used a Capital 'P' while initiating the 'RealmSwift' command in the podfile. I had same issue, it got solved by fixing this mistake.

kicnoman avatar Jan 20 '23 19:01 kicnoman

100% Guaranteed Answer:

gem install cocoapods-user-defined-build-types

I owe you a million $ if it doesn't work.

najeeb-whitewings avatar Jan 30 '23 18:01 najeeb-whitewings

This solution works for me: https://github.com/joncardasis/cocoapods-user-defined-build-types/issues/2#issuecomment-847176599

davidtran avatar May 03 '24 08:05 davidtran