Problems with AFNetworking

864 views
Skip to first unread message

Eric Ponce

unread,
Mar 5, 2014, 3:57:15 PM3/5/14
to loopb...@googlegroups.com
Hello!! :)

I'm using LoopBack in my iOS app and I'm trying to use AFNetworking too.

I have some problems of compatibility when I try to run the project. Im not sure about this, maybe AFN is not the problem.

This is the error code (a little part):

duplicate symbol _OBJC_CLASS_$_AFHTTPRequestOperation in:
/Users/Eric/Downloads/LoopBack.framework/LoopBack(AFHTTPRequestOperation.o)
/Users/Eric/Library/Developer/Xcode/DerivedData/aghjejcnvucsisgarhhipvztyvoe/Build/Products/Debug-iphonesimulator/libPods.a(AFHTTPRequestOperation.o)


duplicate symbol _OBJC_METACLASS_$_AFHTTPRequestOperation in:
/Users/Eric/Downloads/LoopBack.framework/LoopBack(AFHTTPRequestOperation.o)
/Users/Eric/Library/Developer/Xcode/DerivedData/app-aghjejcnvucsisgarhhipvztyvoe/Build/Products/Debug-iphonesimulator/libPods.a(AFHTTPRequestOperation.o)


duplicate symbol _OBJC_IVAR_$_AFNetworkActivityIndicatorManager._activityIndicatorVisibilityTimer in:
/Users/Eric/Downloads/LoopBack.framework/LoopBack(AFNetworkActivityIndicatorManager.o)
/Users/Eric/Library/Developer/Xcode/DerivedData/app-aghjejcnvucsisgarhhipvztyvoe/Build/Products/Debug-iphonesimulator/libPods.a(AFNetworkActivityIndicatorManager.o)


duplicate symbol _OBJC_IVAR_$_AFNetworkActivityIndicatorManager._activityCount in:
/Users/Eric/Downloads/LoopBack.framework/LoopBack(AFNetworkActivityIndicatorManager.o)
/Users/Eric/Library/Developer/Xcode/DerivedData/app-aghjejcnvucsisgarhhipvztyvoe/Build/Products/Debug-iphonesimulator/libPods.a(AFNetworkActivityIndicatorManager.o)

(+70 more same errors)

ld: 74 duplicate symbols for architecture i386
clang
: error: linker command failed with exit code 1 (use -v to see invocation)


I have checked the headers looking for duplicated code or something, but it looks like that all its correct.

Thanks a lot!!

Raymond Feng

unread,
Mar 5, 2014, 4:08:10 PM3/5/14
to Eric Ponce, loopb...@googlegroups.com
Hi, Eric.

We do embed a copy of AFNetworking 1.x with the iOS SDK. See: https://github.com/strongloop/strong-remoting-clients/tree/master/ios/AFNetworking. There is an issue (https://github.com/strongloop/loopback-ios/issues/5) opened to use http://cocoapods.org/ to manage the dependencies.

Thanks,

---
Raymond Feng
Co-Founder and Architect @ StrongLoop, Inc.

StrongLoop makes it easy to develop APIs in Node, plus get DevOps capabilities like monitoring, debugging and clustering.

On Mar 5, 2014, at 12:57 PM, Eric Ponce <ponc...@gmail.com> wrote:

Hello!! :)

I'm using LoopBack in my iOS app and I'm trying to use AFNetworking too.

I have some problems of compatibility when I try to run the project. Im not sure about this, maybe AFN is not the problem.

This is the error code (a little part):

duplicate symbol _OBJC_CLASS_$_AFHTTPRequestOperation in:
/Users/Eric/Downloads/LoopBack.framework/LoopBack(AFHTTPRequestOperation.o)
/Users/Eric/Library/Developer/Xcode/DerivedData/aghjejcnvucsisgarhhipvztyvoe/Build/Products/Debug-iphonesimulator/libPods.a(AFHTTPRequestOperation.o)
duplicate symbol _OBJC_METACLASS_$_AFHTTPRequestOperation in:
/Users/Eric/Downloads/LoopBack.framework/LoopBack(AFHTTPRequestOperation.o)
/Users/Eric/Library/Developer/Xcode/DerivedData/app-aghjejcnvucsisgarhhipvztyvoe/Build/Products/Debug-iphonesimulator/libPods.a(AFHTTPRequestOperation.o)
duplicate symbol _OBJC_IVAR_$_AFNetworkActivityIndicatorManager._activityIndicatorVisibilityTimer in:
/Users/Eric/Downloads/LoopBack.framework/LoopBack(AFNetworkActivityIndicatorManager.o)
/Users/Eric/Library/Developer/Xcode/DerivedData/app-aghjejcnvucsisgarhhipvztyvoe/Build/Products/Debug-iphonesimulator/libPods.a(AFNetworkActivityIndicatorManager.o)
duplicate symbol _OBJC_IVAR_$_AFNetworkActivityIndicatorManager._activityCount in:
/Users/Eric/Downloads/LoopBack.framework/LoopBack(AFNetworkActivityIndicatorManager.o)
/Users/Eric/Library/Developer/Xcode/DerivedData/app-aghjejcnvucsisgarhhipvztyvoe/Build/Products/Debug-iphonesimulator/libPods.a(AFNetworkActivityIndicatorManager.o)

(+70 more same errors)ld: 74 duplicate symbols for architecture i386

clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have checked the headers looking for duplicated code or something, but it looks like that all its correct.

Thanks a lot!!


--
You received this message because you are subscribed to the Google Groups "LoopbackJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to loopbackjs+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Eric Ponce

unread,
Mar 5, 2014, 4:53:01 PM3/5/14
to loopb...@googlegroups.com
Nice!

How can I use it the embed copy?
Thanks!

Raymond Feng

unread,
Mar 5, 2014, 5:27:49 PM3/5/14
to Eric Ponce, loopb...@googlegroups.com
I would assume if you use loopback iOS SDK as a framework for your app, the AF classes should be visible automatically. You might have to remove your own dependency to AFNetworking though.

Thanks,

---
Raymond Feng
Co-Founder and Architect @ StrongLoop, Inc.

StrongLoop makes it easy to develop APIs in Node, plus get DevOps capabilities like monitoring, debugging and clustering.

On Mar 5, 2014, at 1:53 PM, Eric Ponce <ponc...@gmail.com> wrote:

Nice!

How can I use it the embed copy?
Thanks!

El miércoles, 5 de marzo de 2014 21:57:15 UTC+1, Eric Ponce escribió:
Hello!! :)

I'm using LoopBack in my iOS app and I'm trying to use AFNetworking too.

I have some problems of compatibility when I try to run the project. Im not sure about this, maybe AFN is not the problem.

This is the error code (a little part):

duplicate symbol _OBJC_CLASS_$_AFHTTPRequestOperation in:
/Users/Eric/Downloads/LoopBack.framework/LoopBack(AFHTTPRequestOperation.o)
/Users/Eric/Library/Developer/Xcode/DerivedData/aghjejcnvucsisgarhhipvztyvoe/Build/Products/Debug-iphonesimulator/libPods.a(AFHTTPRequestOperation.o)
duplicate symbol _OBJC_METACLASS_$_AFHTTPRequestOperation in:
/Users/Eric/Downloads/LoopBack.framework/LoopBack(AFHTTPRequestOperation.o)
/Users/Eric/Library/Developer/Xcode/DerivedData/app-aghjejcnvucsisgarhhipvztyvoe/Build/Products/Debug-iphonesimulator/libPods.a(AFHTTPRequestOperation.o)
duplicate symbol _OBJC_IVAR_$_AFNetworkActivityIndicatorManager._activityIndicatorVisibilityTimer in:
/Users/Eric/Downloads/LoopBack.framework/LoopBack(AFNetworkActivityIndicatorManager.o)
/Users/Eric/Library/Developer/Xcode/DerivedData/app-aghjejcnvucsisgarhhipvztyvoe/Build/Products/Debug-iphonesimulator/libPods.a(AFNetworkActivityIndicatorManager.o)
duplicate symbol _OBJC_IVAR_$_AFNetworkActivityIndicatorManager._activityCount in:
/Users/Eric/Downloads/LoopBack.framework/LoopBack(AFNetworkActivityIndicatorManager.o)
/Users/Eric/Library/Developer/Xcode/DerivedData/app-aghjejcnvucsisgarhhipvztyvoe/Build/Products/Debug-iphonesimulator/libPods.a(AFNetworkActivityIndicatorManager.o)

(+70 more same errors)ld: 74 duplicate symbols for architecture i386

clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have checked the headers looking for duplicated code or something, but it looks like that all its correct.

Thanks a lot!!


Eric Ponce

unread,
Mar 5, 2014, 6:10:38 PM3/5/14
to loopb...@googlegroups.com
Ok!

I have removed my own dependency.

Now: If I write this directly:

 AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];

I have this error:  
Use of undeclared identifier 'AFHTTPRequestOperationManager'
Use of undeclared identifier 'manager'

Ok, now, if I import the AFN header: #import <LoopBack/AFNetworking.h>

I have this other error: 'AFXMLRequestOperation.h' file not found

I'm sorry, i'm new and i'm a bit lost.

What can I do and what I'm doing wrong?

thanks!! 






El miércoles, 5 de marzo de 2014 21:57:15 UTC+1, Eric Ponce escribió:

Raymond Feng

unread,
Mar 5, 2014, 6:12:03 PM3/5/14
to Eric Ponce, loopb...@googlegroups.com
Maybe you code depends on AFNetworking 2.x? The one from LoopBack is 1.x.

Thanks,

---
Raymond Feng
Co-Founder and Architect @ StrongLoop, Inc.

StrongLoop makes it easy to develop APIs in Node, plus get DevOps capabilities like monitoring, debugging and clustering.

(+70 more same errors)ld: 74 duplicate symbols for architecture i386

clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have checked the headers looking for duplicated code or something, but it looks like that all its correct.

Thanks a lot!!


Eric Ponce

unread,
Mar 6, 2014, 3:44:58 AM3/6/14
to loopb...@googlegroups.com
Yes, I was coding for 2.x.

But now, i'm coding for 1.x and the result is the same.

In the Headers folder into loopback framework I have this:

BUT the my error is that the library  "AFXMLRequestOperation.h" is missing.
If I comment this line, there is another wrong import:

And finally if I comment this line, the project runs correctly

Could be a bug? I have downloaded 3 times the loopback framework from the main website and the result is always the same.

Thanks!!! ;)

El miércoles, 5 de marzo de 2014 21:57:15 UTC+1, Eric Ponce escribió:

Raymond Feng

unread,
Mar 6, 2014, 11:34:48 AM3/6/14
to Eric Ponce, loopb...@googlegroups.com
Good catch, some of the header files from AFNetworking are not marked as ‘public’. I’ll fix it and give you a new tar ball to try.


Thanks,

---
Raymond Feng
Co-Founder and Architect @ StrongLoop, Inc.

StrongLoop makes it easy to develop APIs in Node, plus get DevOps capabilities like monitoring, debugging and clustering.

(+70 more same errors)ld: 74 duplicate symbols for architecture i386

clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have checked the headers looking for duplicated code or something, but it looks like that all its correct.

Thanks a lot!!


Eric Ponce

unread,
Mar 6, 2014, 6:01:07 PM3/6/14
to loopb...@googlegroups.com, Eric Ponce
Thanks a lot!

But one thing more. Work with the 1.X version is very dificult for me. Because the functions are too old...
Its possible to add the last version (2.2.0) ?

Thanks ;)

Raymond Feng

unread,
Mar 6, 2014, 7:20:32 PM3/6/14
to Eric Ponce, loopb...@googlegroups.com
It’s on the roadmap. Hopefully the migration won’t be difficult. If you can help us to fix the code, you are very welcome too :-)

Thanks,

---
Raymond Feng
Co-Founder and Architect @ StrongLoop, Inc.

StrongLoop makes it easy to develop APIs in Node, plus get DevOps capabilities like monitoring, debugging and clustering.

Reply all
Reply to author
Forward
0 new messages