Birdhouse Crash - Attempt to insert nil value?

You must Login before you can answer or comment on any questions.

Hey guys,

I'm using Birdhouse's class to connect to Twitter.

However, I'm crashing right on the instantiation of the object. Here's what I do:

//twitterController() is just Birdhouse() renamed.
var twClient = new App.Controllers.twitterController({
    consumer_key: 'myConsumerKey',
    consumer_secret: 'myConsumerSecret'
});
And this is the error I'm getting:
[ERROR] Script Error = -[__NSCFDictionary setObject:forKey:]: attempt to insert nil value (key: Filesystem) at twitterController.js (line 324).
The line is:
// try to find file
var file = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'twitter.config');
I've had this same [__NSCFDictionary setObject:forKey:] attempt to insert nil value error before, but I can't remember how I solved it on the other situation.

Does anyone know what's causing this?

Thanks!

— asked 2 years ago by Bernardo Oliveira
2 Comments
  • Here's the link to Birdhouse on Github:

    https://github.com/jpurcell/birdhouse

    — commented 2 years ago by Bernardo Oliveira

  • Hi,

    I am facing a similar issue with my project. I am just curious to know if you were able to find any solution for this. Thanks!! :)

    — commented 2 years ago by Abhilash Goje

1 Answer

Are you certain that the twitter.config file is present in your applicationDataDirectory? If so, can you inspect the config file for any potential values that may be invalid?

— answered 2 years ago by Tony Lukasavage
answer permalink
2 Comments
  • Well, no because I suppose the script should create the file if it's not there. It starts loading the access_token but if it's not there, it then creates it with save_access_token().

    Plus, on the Github repository page the mention to twitter.config is a line that says: - authorize: this initiates the authorization sequence, storing credentials in the app's directory in a file called 'twitter.config', returns void.

    I created a blank file called twitter.config and placed it on the / and /Resources folders, just to see if it worked, but without success.

    Do you know where I'm supposed to place this file and what's the content of this file?

    — commented 2 years ago by Bernardo Oliveira

  • Actually, I just discovered that the problem is with this call: Ti.Filesystem.applicationDataDirectory.

    I added this line:

    alert(Ti.Filesystem.applicationDataDirectory);
    And it caused the same problem. Any ideas?

    — commented 2 years ago by Bernardo Oliveira

Your Answer

Think you can help? Login to answer this question!