joncardasis / cocoapods-user-defined-build-types

⚒ A cocoapods plugin that can selectively set build type per pod (static library, dynamic framework, etc.)
MIT License
134 stars 10 forks source link

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

Open amitprk13 opened 3 years ago

amitprk13 commented 3 years ago

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

yeasitech commented 3 years ago

I am facing the same issue

amitprk13 commented 3 years ago

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

liz123cn commented 3 years ago

same issure:
pod install

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

iGroza commented 3 years ago

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

nethergrim commented 2 years ago

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

penghouho commented 2 years ago

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

Puneet-Chicmic commented 1 year ago

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

fleuverouge commented 1 year ago

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

kicnoman commented 1 year ago

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.

najeeb-whitewings commented 1 year ago

100% Guaranteed Answer:

gem install cocoapods-user-defined-build-types

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

davidtran commented 2 months ago

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