Q&A

Android SDK Line login failed: Illegal parameter value of ‘state’

Pre condition, Condition to reproduce

In our android app, we integrate Line Login with Line Android SDK. We found that many of our users login with line failed, and the message is "Illegal parameter value of 'state'." Most of them are Android 11, but there are also a few Android 9. We tried to reproduce it. It happened occationally. We don't know why sometimes the error happened while other times it didn't happen.

We found that the error is from:

val lineResult = LineLoginApi.getLoginResultFromIntent(result.data)

we log the lineResult.errorData.message and get the message “Illegal parameter value of ‘state’.”

Issue/ Error Message details

Illegal parameter value of 'state'.

Accompanying respective source code

mLineResultLauncher =
            registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
                if (result.resultCode == Activity.RESULT_OK) {
                    val lineResult = LineLoginApi.getLoginResultFromIntent(result.data)
                    when (lineResult.responseCode) {
                        LineApiResponseCode.SUCCESS -> {
                            Log.d("LineLogin", "Line login response success")
                        }
                    }
                    LineApiResponseCode.CANCEL -> {
                        Log.d("LineLogin", "Line login response cancel")
                    }
                    else -> {
						Utils.logException(Exception("LineApiResponse. ${lineResult.errorData.message}"))
						// Here we got: Illegal parameter value of 'state'.
                    }
                }
           } 

Reference information (Version / Platform/ environment)

Plateform: Android targetSdkVersion: 30. minSdkVersion: 18. Line SDK version: 5.1.1

  • 0
  • 0
  • 276
  • twitter facebook

Similar posts

    No similar posts

Are you sure? question.vm