Birdhouse Crash - Attempt to insert nil value?

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?


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 4 years ago by Tony Lukasavage
    • 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 4 years ago by Bernardo Oliveira
    • Actually, I just discovered that the problem is with this call:

      I added this line:


      And it caused the same problem. Any ideas?

      — commented 4 years ago by Bernardo Oliveira