0

Each time I attempt to Share to Github from Android Studio I receive this error.

Steps Followed:

Installed git

Created a Personal Access Token on Github

Logged in with the token on Android Studio

Attempted to Share to GitHub and received the error

J.Correa
  • 11
  • 4

1 Answers1

0

There was a similar error (for pull request, not share) before which suggested that a mandatory field was missing in answer.

In your case, if you are seeing, when sharing to github.com (not GHE, an on-proemise GitHub for Enterprise)

Can't parse GitHub response

It is possible GitHub has changed their response when Creating a repository.

If you are already at the latest Android Studio version, try and enable the debug option (Help - Debug Log Settings...) for the following categories:

#org.jetbrains.plugins.github.api.GithubApiRequestExecutor

That should show you what is missing in the answer, trigger the parsing error.


As mentioned by the OP J.Correa in the comments, the workaround is to git push one's project directly from command line to GitHub.

You can use for that the GitHub official cli/cli project and its gh command

cd ~/Projects/my-project
# Create a repository for the current directory.
~/Projects/my-project$ gh repo create
✓ Created repository user/my-project on GitHub
✓ Added remote https://github.com/user/my-project.git
~/Projects/my-project$
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Apologies on the late response, unfortunately the above did not work for me, I ended up downloading Git, and used git to send to GitHub – J.Correa Dec 19 '20 at 15:45
  • @J.Correa Thank you for this feedback. I have included your comment in the answer for more visibility, and added a workaround based on the official GitHub `gh` CLI tool. – VonC Dec 19 '20 at 19:33