Flutter Spotfy sdk authentication issue in release builds

Viewed 175

I am facing an issue in flutter release build for spotify sdk authentication issue.it is working fine in debugging mode and connecting with spotify but in release mode its showing an error : [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: PlatformException(authenticationTokenError, Authentication went wrong, AUTHENTICATION_SERVICE_UNAVAILABLE, null).code: PlatformException(authenticationTokenError, Authentication went wrong, AUTHENTICATION_SERVICE_UNAVAILABLE, null).message

3 Answers

Check your debug console while debugging the debug apk and if there are exceptions caught, then fix those exceptions, your issue will be resolved

can you check the SH1 value of release buildType to be same as SH1 value that was given while creating the app in spotify dashboard.

What fixed it for me was to set the applicationId in the build.gradle file (android -> app -> build.gradle).

defaultConfig {
    applicationId "com.example" // <-
    minSdkVersion localProperties.getProperty('flutter.minSdkVersion')
    targetSdkVersion flutter.targetSdkVersion
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
}

The applicationId have to be the same as the Android Package name in you Spotify App config

Android Package

Related