Skip to content

Crash in CreateOpenChatActivity when only using LINE Login (OpenID Connect) #185

@winsonmac

Description

@winsonmac

Description

I'm only using LINE Login (OpenID Connect) for user authentication —
not any of the OpenChat features.
However, my app crashes immediately with the following exception even though I never use CreateOpenChatActivity or OpenChat API:

Caused by java.lang.IllegalArgumentException: channel id is empty
    at com.linecorp.linesdk.api.LineApiClientBuilder.<init>(LineApiClientBuilder.java:42)
    at com.linecorp.linesdk.openchat.ui.CreateOpenChatActivity$lineApiClient$2.invoke(CreateOpenChatActivity.java:32)

This makes it confusing for developers who only integrate LINE Login,
because this metadata is not documented or required anywhere in the LINE Login guide.

Code Example

Here’s the only part of the code where LINE SDK is used in my project:

class LineLoginContract : ActivityResultContract<Unit, LineLoginResult?>() {

    override fun createIntent(context: Context, input: Unit): Intent {
        val loginIntent = LineLoginApi.getLoginIntent(
            context,
            BuildConfig.LINE_CHANNEL_ID,
            LineAuthenticationParams.Builder()
                .scopes(
                    listOf(
                        Scope.PROFILE,
                        Scope.OPENID_CONNECT,
                        Scope.OC_EMAIL
                    )
                )
                .build()
        )
        return loginIntent
    }

    override fun parseResult(resultCode: Int, intent: Intent?): LineLoginResult? {
        if (intent == null) return null
        return LineLoginApi.getLoginResultFromIntent(intent)
    }
}

As you can see, this only uses the LINE Login API — no reference to OpenChat, LineApiClient, or CreateOpenChatActivity.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions