Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoMethodError - undefined method `CFAutoRelease' for #<Fiddle::Pointer:0x007fef1acd3050> #2632

Closed
dornad opened this issue Oct 9, 2014 · 12 comments
Milestone

Comments

@dornad
Copy link

dornad commented Oct 9, 2014

Report

  • What did you do?
    Installed xcodeproj dependency as explained here, then tried to run pod update.
  • What did you expect to happen?
    Pods updating .
  • What happened instead?
    An error report. Here's the output on terminal:
$ pod update
Update all pods
Analyzing dependencies

Stack

   CocoaPods : 0.34.2
        Ruby : ruby 2.0.0p451 (2014-02-24 revision 45167) [universal.x86_64-darwin13]
    RubyGems : 2.0.14
        Host : Mac OS X 10.9.4 (13E28)
       Xcode : 6.0.1 (6A317)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ beec8d325a216a90a3ed58971394c1b8b492713c

Plugins

cocoapods-plugins : 0.3.1
cocoapods-trunk   : 0.3.0
cocoapods-try     : 0.4.1

Podfile

platform :ios, '7.0'

# ignore all warnings from all pods
inhibit_all_warnings!

pod 'SSZipArchive', '0.3.1'
pod 'GoogleAnalytics-iOS-SDK', '3.0.9'
pod 'Parse', '1.4.0'
pod 'cocos2d', '2.1'
pod 'AWSiOSSDK/S3', '1.7.1'
pod 'SVProgressHUD', :head
pod 'KISSmetrics', '1.2.0'
pod 'MobileAppTracker', '~> 3.4'
pod 'Facebook-iOS-SDK', '~> 3.18'

target :HomerKiwiTests, :exclusive => true do
  pod 'Kiwi'
end

Error

NoMethodError - undefined method `CFAutoRelease' for #<Fiddle::Pointer:0x007fef1acd3050>
/Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.19.3/lib/xcodeproj/plist_helper.rb:298:in `ptr'
/Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.19.3/lib/xcodeproj/plist_helper.rb:126:in `RubyHashPropertyListRead'
/Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.19.3/lib/xcodeproj/plist_helper.rb:55:in `read'
/Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.19.3/lib/xcodeproj/plist_helper.rb:6:in `read_plist'
/Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.19.3/lib/xcodeproj/project.rb:175:in `initialize_from_file'
/Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.19.3/lib/xcodeproj/project.rb:92:in `open'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/installer/analyzer.rb:542:in `block (2 levels) in compute_target_platforms'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/installer/analyzer.rb:539:in `each'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/installer/analyzer.rb:539:in `block in compute_target_platforms'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/user_interface.rb:49:in `section'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/installer/analyzer.rb:538:in `compute_target_platforms'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/installer/analyzer.rb:50:in `analyze'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/installer.rb:184:in `analyze'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/installer.rb:106:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/user_interface.rb:49:in `section'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/installer.rb:105:in `resolve_dependencies'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/installer.rb:90:in `install!'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/command/project.rb:71:in `run_install_with_update'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/command/project.rb:155:in `run'
/Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command.rb:271:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/command.rb:48:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/bin/pod:33:in `<top (required)>'
/usr/bin/pod:23:in `load'
/usr/bin/pod:23:in `<main>'
@alloy
Copy link
Member

alloy commented Oct 9, 2014

Wow, this is weird. I guess this is a constant lookup issue in the Ruby version you’re using…

Can you edit line 298 of /Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.19.3/lib/xcodeproj/plist_helper.rb to look like this?

  def self.CFTypeRefPointer
    pointer = Fiddle::Pointer.malloc(Fiddle::SIZEOF_INTPTR_T, free_function)
    def pointer.ptr
      ::CoreFoundation.CFAutoRelease(super)
    end
    pointer
  end

And let me know if that fixes it?

@dornad
Copy link
Author

dornad commented Oct 9, 2014

I got another error this time.

$ pod update
Update all pods
Analyzing dependencies
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/user_interface/error_report.rb:13:in `report': incompatible character encodings: UTF-8 and ASCII-8BIT (Encoding::CompatibilityError)
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/command.rb:61:in `report_error'
    from /Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command.rb:300:in `handle_exception'
    from /Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command.rb:274:in `rescue in run'
    from /Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command.rb:264:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/command.rb:48:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/bin/pod:33:in `<top (required)>'
    from /usr/bin/pod:23:in `load'
    from /usr/bin/pod:23:in `<main>'

@alloy
Copy link
Member

alloy commented Oct 9, 2014

This looks like your terminal is not configured for UTF-8. Something like the following could help, otherwise please use google to find the answer that’s correct for your environment:

export LC_ALL=en_US.UTF-8  
export LANG=en_US.UTF-8

@kylef kylef added this to the 0.34.3 milestone Oct 9, 2014
@alloy
Copy link
Member

alloy commented Oct 10, 2014

@dornad Any update on this? I’m awaiting your input as to whether or not I should be pushing that change.

@florent37
Copy link

I have the same issue, using the UTF8 does not change anything

@idozamberg
Copy link

Having the same issue - any news ?

@florent37
Copy link

It was juste a merging fail with git for me...

@segiddins
Copy link
Member

@dornad ping?

@dornad
Copy link
Author

dornad commented Oct 14, 2014

It was definitely not an issue with the terminal, since another cocoapods project was building.

In the end, I had to go back in time with git, and figure out at what point the project got corrupted. From there, I was able to pinpoint the issue to a faulty merge in a previous commit.

TL;DR A faulty git merge issue in project.pbxproj was causing it.

@alloy
Copy link
Member

alloy commented Oct 15, 2014

Ok, thanks for the update.

@alloy alloy closed this as completed Oct 15, 2014
alloy added a commit to CocoaPods/Xcodeproj that referenced this issue Oct 28, 2014
A few people have reported an issue where the CFAutoRelease constant
could not be found from the singleton method.

* CocoaPods/CocoaPods#2632
* CocoaPods/CocoaPods#2739

I have been unable to reproduce this, but because the issue has been
reported by more than one person, I'm adding this just to be sure.
@paulrehkugler
Copy link

For anyone else with this issue, I saw the same thing because Github for Mac didn't tell me about project file conflicts. If your project file has conflict markers in it, you'll see this. Might be worthwhile to spit out an intelligent error if the project file has conflict markers or is otherwise malformed.

@segiddins
Copy link
Member

@paulrehkugler that's already been done at CocoaPods/Xcodeproj#192 :)

alloy added a commit to CocoaPods/Xcodeproj that referenced this issue Jan 12, 2015
A few people have reported an issue where the CFAutoRelease constant
could not be found from the singleton method.

* CocoaPods/CocoaPods#2632
* CocoaPods/CocoaPods#2739

I have been unable to reproduce this, but because the issue has been
reported by more than one person, I'm adding this just to be sure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants