Note that there are some explanatory texts on larger screens.

plurals
  1. POAccountManager IllegalArgumentException: key is null
    primarykey
    data
    text
    <p>Ok, I'm getting an <code>IllegalArgumentException</code> at a point where it shouldn't. </p> <p>I have a custom extension of <code>Account</code> that is saved using the AccountManager:</p> <pre><code>// Method inside a custom extension of Account public boolean save(AccountManager manager) { removeAll(manager); boolean result = manager.addAccountExplicitly(this, null, toBundle()); manager.setUserData(this, KEY_1, value1); manager.setUserData(this, KEY_2, value2); manager.setUserData(this, KEY_3, value3); return result; } </code></pre> <p>The keys are constant String values but app still throws:</p> <pre><code>java.lang.IllegalArgumentException: key is null </code></pre> <p>I have to say that I'm only attaching the user data in this fashion because using: </p> <pre><code> manager.addAccountExplicitly(this, null, toBundle()); </code></pre> <p>didn't seem to attach the values. Do the keys require a special name pattern?</p> <p>Anybody had this problem before?</p> <hr> <p><strong>Update:</strong></p> <p>It gets thrown inside the <code>manager.setUserData()</code> which looks like this (Android code):</p> <pre><code>public void setUserData(final Account account, final String key, final String value) { if (account == null) throw new IllegalArgumentException("account is null"); if (key == null) throw new IllegalArgumentException("key is null"); try { mService.setUserData(account, key, value); } catch (RemoteException e) { // won't ever happen throw new RuntimeException(e); } } </code></pre> <p>When I "walk" into this method with eclipse I get this in the debug perspective:</p> <p><img src="https://i.stack.imgur.com/83KwX.png" alt="enter image description here"></p> <p>The values aren't null >o&lt;</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload