'Unable to connect to DialogFlow CX with flutter app, instead it always redirect to DialogFlow ES

Steps to recreate:

In the Cloud Console, go to the Create service account page.

Go to Create service account
Select your project.
In the Service account name field, enter a name. The Cloud Console fills in the Service account ID field based on this name.

In the Service account description field, enter a description. For example, Service account for quickstart.

Click Create and continue.
To provide access to your project, grant the following role(s) to your service account: Project > Owner.

In the Select a role list, select a role.

For additional roles, click add Add another role and add each additional role.

Note: The Role field affects which resources your service account can access in your project. You can revoke these roles or grant additional roles later. In production environments, do not grant the Owner, Editor, or Viewer roles. Instead, grant a predefined role or custom role that meets your needs.
Click Continue.
Click Done to finish creating the service account.

Do not close your browser window. You will use it in the next step.

Create a service account key:

In the Cloud Console, click the email address for the service account that you created.
Click Keys.
Click Add key, then click Create new key.
Click Create. A JSON key file is downloaded to your computer.
Click Close.

Note: There is only one DialogFlow API in google cloud for both Dialogflow ES and CX, and if I pass the api key in the code it always automatically connects to DialogFlow ES!!!, if there is no project in ES it'll still direct you to ES and blank from there on(As there is no project in it)


There is one library that can be added in Gradle, but it's currently not supported for Android, Hence gives an error if you try to add it.

implementation 'com.google.cloud:google-cloud-dialogflow-cx:0.12.0'

Complete setup documentation: https://cloud.google.com/dialogflow/cx/docs/quick/setup#java



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source