The problem ‘Unable to connect to the server: getting credentials: decoding stdout: no kind “ExecCredential” is registered for version’ is seen when you are working on amazon web services and are trying to use its services in your application.
Given below is the snippet of the problem ‘Unable to connect to the server: getting credentials: decoding stdout: no kind “ExecCredential” is registered for version’ even after you tried to restart your application :
Unable to connect to the server: getting credentials: decoding stdout: no kind "ExecCredential" is registered for version "client.authentication.k8s.io/v1alpha1" in scheme "pkg/client/auth/exec/exec.go:62"

The problem, ‘Unable to connect to the server: getting credentials: decoding stdout: no kind “ExecCredential” is registered for version’ is seen because the the aws cli version is not up to date with latest available version.
The latest version to update to now is version 2.7.25 and in addition you will also have to make sure that your cli is pointing to the right region.
For a quick fix you can upgrade your aws cli to the latest version to solve your error.
To fix the error “Unable to connect to the server: getting credentials: decoding stdout: no kind “ExecCredential” is registered for version”, Ensure that your AWS CLI is pointed to the correct region and updgrade it to >2.7.25 or the most recent version (preferred), and then attempt eksctl utils write-kubeconfig —cluster=name>.
Check that client.authentication.k8s.io/v1beta has replaced client.authentication.k8s.io/v1alpha1 in the kubeconfig file.
Steps to Fix the problem “Unable to connect to the server: getting credentials: decoding stdout: no kind “ExecCredential” is registered for version” Android Studio:
First you will have to make sure that your AWS CLI is pointed to the correct region, update it to >2.7.25 or the most recent version (preferred), and then attempt eksctl utils write-kubeconfig —cluster=name>. This should be your first step
Once you have followed the above step make sure to check that client.authentication.k8s.io/v1beta has replaced client.authentication.k8s.io/v1alpha1 in the kubeconfig file.
This should help you fix and understand the problem, ‘Android Studio xml preview issue failed to initialize editor’
Conclusion
The reason why you are seeing the issue, “Unable to connect to the server: getting credentials: decoding stdout: no kind “ExecCredential” is registered for version” is that the AWS cli version is out of date.
Version 2.7.25 is the most recent version that needs to be updated, and you must also make sure that your cli is pointing to the proper region.