Skip to content

Spotify Android remote SDK fails to start auth activity when connecting on OS 14 #377

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
hanan-rofe-haim opened this issue Feb 9, 2025 · 4 comments

Comments

@hanan-rofe-haim
Copy link

hanan-rofe-haim commented Feb 9, 2025

Using the connect method from the remote library hangs without any callback.
Looking at the logs you can see that:

12:05:04.571 1891-4330 ActivityTaskManager pid-1891 Background activity launch blocked! [callingPackage: com.spotify.music; callingPackageTargetSdk: 35; callingUid: 10345; callingPid: 4379; appSwitchState: 2; callingUidHasAnyVisibleWindow: false; callingUidProcState: BOUND_TOP; isCallingUidPersistentSystemProcess: false; forcedBalByPiSender: BSP.NONE; intent: Intent { act=com.spotify.appauthorization.sso.action.ACTIVITY cat=[android.intent.category.DEFAULT] flg=0x10000000 pkg=com.spotify.music cmp=com.spotify.music/com.spotify.appauthorization.sso.internalauth.AuthorizationActivityInternalProxy (has extras) }; callerApp: ProcessRecord{5cb10ff 4379:com.spotify.music/u0a345}; inVisibleTask: false; balAllowedByPiCreator: BSP.ALLOW_BAL; balAllowedByPiCreatorWithHardening: BSP.ALLOW_BAL; resultIfPiCreatorAllowsBal: BAL_BLOCK; hasRealCaller: true; isCallForResult: false; isPendingIntent: false; autoOptInReason: notPendingIntent; realCallingPackage: com.spotify.music; realCallingPackageTargetSdk: 35; realCallingUid: 10345; realCallingPid: 4379; realCallingUidHasAnyVisibleWindow: false; realCallingUidProcState: BOUND_TOP; isRealCallingUidPersistentSystemProcess: false; originatingPendingIntent: null; realCallerApp: ProcessRecord{5cb10ff 4379:com.spotify.music/u0a345}; realInVisibleTask: false; balAllowedByPiSender: BSP.ALLOW_BAL; resultIfPiSenderAllowsBal: BAL_BLOCK]

Essentially the OS is blocking the Spotify app from starting the auth activity from the background.
An easy workaround that also proves this is the issue is to connect to Spotify (e.g from a service) while the Spotify app is in the foreground, which works fine.

I assume it used to work since android allows background activity starts if your app has a service that is bounded from a foreground app.
BUT, on OS 14 google added this restriction:
Starting from Android 14, if the app bound to the service is targeting Android 14 or higher, it no longer allows the app that has the service to start a background activity by default. The app has to pass the flag Context.BIND_ALLOW_ACTIVITY_STARTS to allow the bound service app to start background activities.

I suspect it has something to do with this limitation added on OS 14, but someone from the Spotify team needs to verify this.

@hujie23
Copy link

hujie23 commented Feb 20, 2025

I'm also having the same issue

@soubhikde
Copy link

This sdk does not support on android 14. Please fix asap.

@dtsMithun
Copy link

dtsMithun commented Mar 3, 2025

This SDK is not compatible with Android 14. Please address this issue as soon as possible.
After around 15 minutes, its throws "PlatformException(errorConnection, Something went wrong connecting spotify remote, com.spotify.protocol.error.SpotifyAppRemoteException: Result was not delivered on time., null)"

@KevPantelakis
Copy link

Same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants
@KevPantelakis @dtsMithun @hanan-rofe-haim @soubhikde @hujie23 and others