objective-c - cocoa pods error! undefined local variable or method
天蓬老师
天蓬老师 2017-05-02 09:21:06
0
2
694

我在使用cocoa pods 的时候,出现下面的错误
[!] Invalid Podfile file: undefined local variable or method `afnetworking' for #<Pod::Podfile:0x007fa6c11591f8>. Updating CocoaPods might fix the issue.

关键是我不管导入什么第三方库都会出现这个,一直都导不进去

profile里面我只是写了
pod ‘sdwebimage’

也没有用到afnetworking,ruby环境重新装,cocoa pods 更新什么的都试过了,连mac的系统都更新了,还是不行,,就是不行!!!
求个大神帮我看看怎么回事

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(2)
给我你的怀抱

The problem is not very clear. You can try to check your Podfile. The correct way is this:

pod 'AFNetworking', '~> 2.5'

Many people write their quotation marks like this

pod ‘AFNetworking’, ‘~> 2.5′ 

It’s best to use vim when editing files, give it a try. Be sure to follow the official format. For example:

platform :ios, '9.0'

Many people will add an extra space after:, which will also cause an error.

PHPzhong

No, no matter what I enter, I get an error
[!] Invalid Podfile file: undefined local variable or method `afnetworking' for #<Pod::Podfile:0x007fa6c11591f8>. Updating CocoaPods might fix the issue.

The key point is that no matter whether I import any framework or not, I always get an error saying that afnetworking is not found. When I import other frameworks, such as sdwebimage, I always get an error saying that afnetworking is not found.

The afnetworking framework is not used, why do I always get an error and cannot find afnetworking?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template