android-sdk icon indicating copy to clipboard operation
android-sdk copied to clipboard

Android API 19 Auth not working anymore

Open anscash opened this issue 5 years ago • 10 comments
trafficstars

Hi guys!

I am using your SpotifySDK (Auth &Remote) with my old Galaxy S4 Mini, API 19. I have the following issue that i did'nt have before. When i try to login through the AuthSDK, the SDK Login fails and the WebView-Fallback-Login could not be completed; i get this error being logged: E/com.spotify.sdk.android.authentication.LoginActivity: Can't use LoginActivity with a null caller. Possible reasons: calling activity has a singleInstance mode or LoginActivity is in a singleInstance/singleTask mode

Maybe this is a new issue triggered by the update to SDK v.0.7. I am used to the AuthSDK not working on API19 but at least the Webview fallback always worked on this phone. Now this is no longer possible.

I hope you can help me and my stoneage-smartphone-buddys!

Issue found on 11.01.2020.

SDK Version:

0.7

OS Version:

API 19 (Galaxy S4 Mini)

Scope(s):

app remote

Actual behaviour:

  1. Implement the auth flow like in your docs (Auth SDK with Webview fallback)
  2. Open App
  3. SDK fails, Webview fallback starts
  4. Log: 01-11 11:45:03.956 9445-9445/xxxxx E/com.spotify.sdk.android.authentication.LoginActivity: Can't use LoginActivity with a null caller. Possible reasons: calling activity has a singleInstance mode or LoginActivity is in a singleInstance/singleTask mode

anscash avatar Jan 11 '20 10:01 anscash

Hi @anscash I know there has been a change on the LoginActivity launch-mode recently. Can you share with me which Spotify version are you using?

mdelolmo avatar Jan 15 '20 13:01 mdelolmo

Hi @mdelolmo Sure. I am using Spotify 8.5.40.195

Greetings

anscash avatar Jan 15 '20 17:01 anscash

Hi @anscash Can you try our new version of the auth-lib, to see if it makes a difference? implementation 'com.spotify.android:auth:1.2.2'

mdelolmo avatar Jan 17 '20 15:01 mdelolmo

Hi @mdelolmo

Unfortunately not, the app still tries to

  • connect through SingleSignOn -> not working
  • browser-fallback: URL is being loaded but -> no "result" (result would be a successful redirect to my app)

Happy day! anscash

anscash avatar Jan 17 '20 15:01 anscash

Me, too. I cannot perform any SSO with the Android API anymore for some days. I changed to auth:1.2.2, where is a breaking API change. But this didn't help - same error occurs ("INVALID_CLIENT") ... I tried #185 and added also my publishing key (instead of the upload key) from the Android Developer Console / App Signature. In my local environment that seems to work. I will check whether it stills works after releasing...

ehambuch avatar Jan 18 '20 18:01 ehambuch

Hi @ehambuch I don't think your error is the same one as the one @anscash is having. The INVALID_CLIENT error is due to a configuration error. Maybe it's better to discuss your error on https://github.com/spotify/android-sdk/issues/185, which seems more related.

mdelolmo avatar Jan 20 '20 09:01 mdelolmo

Hi @anscash I gotted the same problem but with the new version of auth-lib: implementation project(':spotify-auth-release-1.2.3') my problem is almost fixed, in this new version the implementation of webview fallback works with Android API 19 but only if Spotify app isn't installed

nakeisha0601 avatar Dec 10 '20 19:12 nakeisha0601

With the 1.2.5 it would open the webview instead of the app. Bumping to 1.2.6 solved it for me.

antoinerousseau avatar Apr 18 '23 17:04 antoinerousseau

Highly recommend updating your targetSdkVersion to 23 since there are new changes and policies coming to the Google Play Store. If not and this is just a personal thing, hope you figure it out!

joseandroidengineer avatar Apr 19 '23 16:04 joseandroidengineer

I was seeing this issue when I had the manifest intent filter set to the wrong android:host value. I have it set to the right thing now and it works just fine!

Jawnnypoo avatar Apr 12 '24 05:04 Jawnnypoo