Note that there are some explanatory texts on larger screens.

plurals
  1. POIOException thrown by AccountManagerFuture.getResults whereas connection is alive
    primarykey
    data
    text
    <p>The following method systematically throws a IOException when invoked on my Android device whereas the internet connection is alive (I can retrieve emails or connect to gmail using my Android device).</p> <p>Can anyone please help?</p> <pre><code>private void performAuthentication() { Log.d("GAWidget", "performAuthentication"); GoogleCredential credential = new GoogleCredential(); GoogleAccountManager accountManager = new GoogleAccountManager(this); Log.d("GAWidget", "after getting accountManager"); Account account = accountManager.getAccountByName("balteo@gmail.com"); Log.d("GAWidget", "after getting account"+"account.name: "+account.name); accountManager.getAccountManager().getAuthToken(account, "oauth2:https://www.googleapis.com/auth/‌​analytics.readonly", true, new AccountManagerCallback&lt;Bundle&gt;() { public void run(AccountManagerFuture&lt;Bundle&gt; future) { try { String token = future.getResult(15, TimeUnit.SECONDS).getString(AccountManager.KEY_AUTHTOKEN); Log.d("GAWidget", "token: "+token); useToken(token); } catch (OperationCanceledException e) { Log.e("GAWidget", "OperationCanceledException", e); } catch (AuthenticatorException e) { Log.e("GAWidget", "AuthenticatorException", e); } catch (IOException e) { Log.e("GAWidget", "IOException", e); } } }, null); } </code></pre> <p>Edit: Here is the stack trace:</p> <pre><code>05-27 19:09:04.319: E/GAWidget(12487): IOException 05-27 19:09:04.319: E/GAWidget(12487): java.io.IOException 05-27 19:09:04.319: E/GAWidget(12487): at android.accounts.AccountManager.convertErrorToException(AccountManager.java:1440) 05-27 19:09:04.319: E/GAWidget(12487): at android.accounts.AccountManager.access$400(AccountManager.java:138) 05-27 19:09:04.319: E/GAWidget(12487): at android.accounts.AccountManager$AmsTask$Response.onError(AccountManager.java:1301) 05-27 19:09:04.319: E/GAWidget(12487): at android.accounts.IAccountManagerResponse$Stub.onTransact(IAccountManagerResponse.java:69) 05-27 19:09:04.319: E/GAWidget(12487): at android.os.Binder.execTransact(Binder.java:320) 05-27 19:09:04.319: E/GAWidget(12487): at dalvik.system.NativeStart.run(Native Method) </code></pre> <p>shipped jars:</p> <pre><code>google-http-client-1.9.0-beta.jar google-http-client-android2-1.9.0-beta.jar (only for SDK &gt;= 2.1) google-http-client-android3-1.9.0-beta.jar (only for SDK &gt;= 3.0) gson-2.1.jar guava-11.0.1.jar jackson-core-asl-1.9.4.jar jsr305-1.3.9.jar protobuf-java-2.2.0.jar </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
    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