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

BFObjectIdentifier toData: unrecognized selector #9

Closed
jyounus opened this issue Oct 9, 2015 · 8 comments
Closed

BFObjectIdentifier toData: unrecognized selector #9

jyounus opened this issue Oct 9, 2015 · 8 comments

Comments

@jyounus
Copy link

jyounus commented Oct 9, 2015

Hey,

How about open sourcing the code instead of just a compiled SDK? Would be great for me to debug an issue I'm having in Swift 2.0 and Xcode 7. The sample project in your other repo (after my pull request) works fine. But if I integrate it into my own project using Cocoapods, I get the following crash:

2015-10-09 13:56:24.184 TestProject[51890:646959] -[BFObjectIdentifier toData]: unrecognized selector sent to instance 0x7fc61a17e6a0
2015-10-09 13:56:24.369 TestProject[51890:646959] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[BFObjectIdentifier toData]: unrecognized selector sent to instance 0x7fc61a17e6a0'
*** First throw call stack:
(
    0   CoreFoundation                      0x0000000106635f65 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x000000010807edeb objc_exception_throw + 48
    2   CoreFoundation                      0x000000010663e58d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
    3   CoreFoundation                      0x000000010658bf7a ___forwarding___ + 970
    4   CoreFoundation                      0x000000010658bb28 _CF_forwarding_prep_0 + 120
    5   Matcher                             0x0000000105c8847d -[BFIssueManager sendIssuesWithSessionIdentifier:] + 45
    6   Matcher                             0x0000000105c7187d -[BFStorageItem bgf_sendLogsWithCompletionBlock:] + 184
    7   Matcher                             0x0000000105c7126d __41-[BFStorageItem sendWithCompletionBlock:]_block_invoke_3 + 136
    8   libdispatch.dylib                   0x0000000109358ef9 _dispatch_call_block_and_release + 12
    9   libdispatch.dylib                   0x000000010937949b _dispatch_client_callout + 8
    10  libdispatch.dylib                   0x0000000109361c8b _dispatch_root_queue_drain + 1829
    11  libdispatch.dylib                   0x0000000109361561 _dispatch_worker_thread3 + 111
    12  libsystem_pthread.dylib             0x00000001096aa4f2 _pthread_wqthread + 1129
    13  libsystem_pthread.dylib             0x00000001096a8375 start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException

I have no idea what the issue is or how to debug it since I don't have access to the source code. Any ideas what the issue may be? I'm literally just using this in my AppDelegate:

Bugfender.activateLogger("*my key here*")

let string = Bugfender.deviceIdentifier();
NSUserDefaults.standardUserDefaults().setObject(string, forKey: "device_id")

BFLog("#######################")
BFLog("")

BFLog("Test log! :D")

Thanks

@jgimenez jgimenez changed the title Open sourcing the code BFObjectIdentifier toData: unrecognized selector Oct 9, 2015
@jgimenez
Copy link
Member

jgimenez commented Oct 9, 2015

Hi @jyounus , we'll look into it.

@jyounus
Copy link
Author

jyounus commented Oct 9, 2015

Okay, thanks. I managed to narrow the issue down to this line of code:

Bugfender.activateLogger("xxx")

I've commented the rest of the code out, as soon as that line is uncommented, it crashes on start up in the simulator. (I obviously replaced my app key)

@jgimenez
Copy link
Member

jgimenez commented Oct 9, 2015

Hi @jyounus if it works with the demo app, the problem must be probably somewhere in your project configuration. If you'd be able to create a small proof of concept and send it over would be awesome. You can put them here or send them privately to support@bugfender.com

@jyounus
Copy link
Author

jyounus commented Oct 9, 2015

I just created a brand new project and added the pod files. Still the same issue.
I emailed you a zipped up project with my app key included in there.

Let me know if you can reproduce it now.

Thanks for looking into this.

@jgimenez
Copy link
Member

jgimenez commented Oct 9, 2015

It looks like it's a CocoaPods bug that results in Objective-C categories not loading. Updating to the latest CocoaPods RC version fixes the problem.

To do so just run gem install cocoapods --pre (or sudo gem install cocoapods --pre depending on your configuration).

@jgimenez jgimenez closed this as completed Oct 9, 2015
@jyounus
Copy link
Author

jyounus commented Oct 9, 2015

Awesome, that seems to have fixed the issue for me!

Thanks a lot, appreciate it! :D

@jgimenez
Copy link
Member

jgimenez commented Oct 9, 2015

You're welcome!

@jgimenez
Copy link
Member

jgimenez commented Oct 9, 2015

Just for future reference if other people come by with the same problem, CocoaPods stable version 0.39.0 has been released with the fix.

gem install cocoapods (or sudo gem install cocoapods) will make it work

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

2 participants