Skip to content

Instantly share code, notes, and snippets.

@ashishb
Last active September 1, 2023 19:35
Show Gist options
  • Save ashishb/108a095603446fa39eb901b006642af6 to your computer and use it in GitHub Desktop.
Save ashishb/108a095603446fa39eb901b006642af6 to your computer and use it in GitHub Desktop.
com.google.auth:google-auth-library-oauth2-http:1.12.0 is good but com.google.auth:google-auth-library-oauth2-http:1.12.1 onwards is broken on API 21
java.lang.NoSuchMethodError: No virtual method getAndSetObject(Ljava/lang/Object;JLjava/lang/Object;)Ljava/lang/Object; in class Lsun/misc/Unsafe; or its super classes (declaration of 'sun.misc.Unsafe' appears in /system/framework/core-libart.jar)
E at com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper.gasWaiters(AbstractFuture.java:1394)
E at com.google.common.util.concurrent.AbstractFuture.releaseWaiters(AbstractFuture.java:1110)
E at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:1000)
E at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:783)
E at com.google.auth.oauth2.OAuth2Credentials$RefreshTask.access$400(OAuth2Credentials.java:600)
E at com.google.auth.oauth2.OAuth2Credentials$RefreshTask$1.onSuccess(OAuth2Credentials.java:617)
E at com.google.auth.oauth2.OAuth2Credentials$RefreshTask$1.onSuccess(OAuth2Credentials.java:614)
E at com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1138)
E at com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:31)
E at com.google.common.util.concurrent.ExecutionList.executeListener(ExecutionList.java:143)
E at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:132)
E at com.google.common.util.concurrent.ListenableFutureTask.done(ListenableFutureTask.java:111)
E at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
E at java.util.concurrent.FutureTask.set(FutureTask.java:204)
E at java.util.concurrent.FutureTask.run(FutureTask.java:245)
E at com.google.auth.oauth2.OAuth2Credentials$RefreshTask.run(OAuth2Credentials.java:633)
E at com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:31)
E at com.google.auth.oauth2.OAuth2Credentials$AsyncRefreshResult.executeIfNew(OAuth2Credentials.java:581)
E at com.google.auth.oauth2.OAuth2Credentials.asyncFetch(OAuth2Credentials.java:232)
E at com.google.auth.oauth2.OAuth2Credentials.getRequestMetadata(OAuth2Credentials.java:182)
E at com.google.auth.oauth2.ServiceAccountCredentials.getRequestMetadata(ServiceAccountCredentials.java:931)
E at com.google.auth.http.HttpCredentialsAdapter.initialize(HttpCredentialsAdapter.java:96)
E at com.google.api.client.http.HttpRequestFactory.buildRequest(HttpRequestFactory.java:91)
E at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.buildHttpRequest(AbstractGoogleClientRequest.java:442)
E at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:552)
E at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:493)
E at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:603)
@ashishb
Copy link
Author

ashishb commented Jun 20, 2023

v1.18 is broken as well.

@ashishb
Copy link
Author

ashishb commented Aug 26, 2023

v1.19 is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment