I don't know whats really wrong with my amplify. I run amplify init and get this error message. I have downloaded my amplify cli using npm and have successfully run 'amplify configure'.
init failed
InvalidSignatureException: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
The Canonical String for this request should have been
'POST
/apps
host:amplify.ap-south-1.amazonaws.com
x-amz-content-sha256:79ec4b759220a7b1d454721bb2c7e1350dccbd691853e5ed1b3c92bec21dbc29
x-amz-date:20210121T154050Z
host;x-amz-content-sha256;x-amz-date
79ec4b759220a7b1d454721bb2c7e1350dccbd691853e5ed1b3c92bec21dbc29'
The String-to-Sign should have been
'AWS4-HMAC-SHA256
20210121T154050Z
20210121/ap-south-1/amplify/aws4_request
b150344845c2c575fd957d63172173a367f2bacf0e817764a02e5b20d03c3811'
Okay, so I finally found out what was bugging me for last three days. A whitespace ( ).
Yes!
I had my folder inside the user with a whitespace in it, as in "First Last". Instead what I should have done is changed my folder name inside my C:\Users\First Last to C:\Users\FirstLast before starting, and then try to install my amplify CLI using the command curl -sL https://aws-amplify.github.io/amplify-cli/install-win -o install.cmd && install.cmd and proceed as mentioned in the documentation here.
To change the name of the User folder in windows 10, I watched this great YT! video
On Mac:
I was also getting the same error while using the aws amplify CLI tool in my nodejs project.
Like #miraquee noted above about the issue being a white space. I suspected that I also had the same issue. What I did to start clean was:
Delete the local .aws folder in my home folder on mac to start clean
rm -rf ~/.aws/
Ran amplify init again. This time when reaching the step where it asks you to create an IAM user, which subsequently takes opens your web browser to finish the creation of the new IAM user, I was very careful about copying in the Access Key Id and Secret Access Key
This time when I went through the flow in the CLI it worked.
If you want to see a video of these steps, checkout this YouTube video built by one of the engineers on the AWS amplify team
Youtube video link: https://www.youtube.com/watch?v=fWbM5DLh25U
I was changed user for github in Android studio and trying to pushing code in repository but its getting error.
Repository successfully creating and commit also but in pushing time getting error.
F:\....>git push -u origin master
remote: Permission to abc.in/abc.git denied to olduser.
fatal: unable to access 'https://..../abc.git/': The requested URL returned error: 403
I also tried new project, but still getting old user name denied access error.
Why don't you push using Android Studio?
Have you got write permission on remote for new user?
Did you changed user in repo too? I think that you still have old data. Check it in project directory
git config user.name
git config user.email
You can check this trick
edit .git/config file under your repo directory
find url=entry under section [remote "origin"]
change it from
url=https://your_user_name#github.com/yy/repo_name.git
to
url=ssh://git#github.com/your_user_name/repo_name.git.
Alternatively
Create new repo in your remote server <- can be skipped
Remove existing git remote from local project
git remote rm origin
Add new remote
git remote add origin https://github.com/your_user_name/repo.git
I have no more idea :)
I have used one Github account to push an android project to Github from Android Studio. Now I have created another account on Github and want to push my another android project to this new account. But I am not able to find any option to change the Github account in Android Studio. It keeps pushing from the previous account and hence results in this error:
remote: Permission to new_username/repository_name.git denied to old_username.
fatal: unable to access 'https://github.com/new_username/repository_name.git/': The requested URL returned error: 403
I am using Android Studio 1.2.2 on Windows OS.
Go to:
Setting --> Version Control --> GitHub --> Change you username.
Step 1
Change file config in directory .git that located in your project folder
Step 2
In terminal # current project, type:
git credential-manager uninstall
Cheers~
Uncheck the Use Credentials Helper from Settings -> Version Control -> Git. Then log in using the desired account and select the account you want to continue with from Settings -> Version Control -> GitHub.
In my case none of working. This way works for me.
Steps:
Open Settings of Android studio
Select Appearance & Behavior
Select System Settings
Select Passwords
Select Do not remember passwords
Click on OK
Now its time to Push your source code to Git, Android studio would ask for new username and its password.
Reference screenshot.
Done
I had the same problem and had solved it.
With current Android Studio 3.5 we can add several github account
with several github account added we can select one for the default for specific project.
or
change the git username and email:
git config user.name "your username"
git config user.email "youremail.com"
add --global if you want change for global config
Perhaps not the answer you are wanting, but you can probably solve this by finding out where the project code is stored by android studio and changing the git remote there.
For example, if you want to change where the main repository you push to, enter this in the command line when inside the project directory:
git remote set-url origin <new-url-from-github>
I tried all methods, mentioned in all answers, but nothing works, but now I finally found the solution of this problem after stuggling from 1 week, so simply the issue is occuring because in window there is credential manager which is storing your old github credential, so simple steps to solve this issue are :-
step 1) Search Credential Manager
step 2) click here on Windows credentials
step 3) Delete your old github credentials
step 4) You are good to go, simply go to android studio and commit and push your code on github using terminal then it will automatically ask your to login to github then click on login via token using github token, then you are good to go :)
Hope this solutions solves everyone github issue :)
When prompted for a username and password, make sure you use an account that has access to the repository.
And in the image of Nir Duan, you must click to the button "test" to verify your connection.
I had the same problem, all you need to do is open your shell and type--
$git config --global user.name [your username]
$git config --global user.email [your email]
since you probably logged in with git using a different account
I solved mine with re-installing,
git credential-manager uninstall
then
git credential-manager install
push to repo
git push --set-upstream origin master
this will ask for authentication, authenticate and BoooMMMM!!!
You need to first go to:
Setting --> Version Control --> GitHub --> Change you username. (just like Nir Duan) said.
Then go to:
VCS --> Checkout of Version Control --> Github
Log in with new credentials if asked, Change the Git URL and possibly parent directory, Click on clone, open in another window, wait for it to load. close the new window.
Next time you want to push you will see the new repository as part of the options at the top left on the "Push commit" pop-up
I was also facing the same issue (working on same PC with diff usernames)
remote: Permission to new_username/repository_name.git denied to old_username.
Tried all solution mentioned even deleting .gitconfig didn't work.
In the end, solved by following different way :
1. Adding as Collaborator to old_username
2. Accept collaboration invitation (Make sure you are logged in to old_username)
3. Push with new_username. Done!
Go VCS>Commit and you will see Author field as shown:
Change author email Id
Edit GitHub Accouts
You can add / remove / replace GitHub accounts on Preferences -> Virsion Control -> GitHub.
If you have generated a new access token, consider removing the deprecated user, and adding the new one using "Log In with token":
I am completely new to Github...
I have been learning Android from udacity and I cloned one of the forks from the public repository.
Now, I want to create my own private repository and push the files to it but it always tries to push them to the udacity repository instead of mine.
Here are the commands I used:
git remote add origin <my_git_url>
git add .
git commit -m "First Commit"
git push origin master
But it just keeps returning this:
remote: Permission to udacity/Sunshine-Version-2.git denied to xxxx.
fatal: unable to access 'https://github.com/udacity/Sunshine-Version-2.git/': The requested URL returned error: 403
Please help....
The error says you don't have rights to push there.
Most probably, you have to fix your repository url.
git remote remove origin
git remote add origin https://github.com/your-username/your-repository
git push origin master
Then it will ask you to provide the credentials. Later you can get rid of that using SSH urls. Here is a nice article on how to get started using SSH keys.
I got a git-server on my Raspberry Pi with gitweb as webinterface.
Its working so far.
Now I want to connect via Android Studio with the built-in ssh to it.
My project dir is :
/home/git/straff.git
I'll connect with this command from Android Studio:
:ssh:git#192.168.178.21:/straff
Android Studio is giving me this when I test the connection:
Cannot access /straff/CVSROOT
I am using password auth for it. I can access from command line tools to my repo...
Why Android Studio cant?
I can access from command line tools to my repo...
Why Android Studio cant?
Your error is you are trying to access 192.168.178.21:/straff which is /straff on that machine. Either provide the full path like below or use this one
:ssh:git#192.168.178.21:straff
Old post:
You can try to specify the full path to Android Studio:
:ssh:git#192.168.178.21:/home/git/straff
I am using password auth for it.
That means the ssh connection doesn't use a private/public (~/.ssh/id_rsa(.pub)) key.
A good tutorial to follow with Android Studio is the one titled "How to push to a remote Git repository over SSH with private/public key authentication using Android Studio".
Hmm, should the URL be like:
ssh://git#192.168.178.21/straff
I had problems with setting ssh key. I solved it by creating id_rsa -titled file under .ssh-directory (under user home-dir) and putting my RSA-stuff into it.
If you already have the remote git repository, which you want to check out, and you have a private key, then the instructions on https://www.londonappdeveloper.com/how-to-push-to-a-remote-git-repository-over-ssh-with-privatepublic-key-authentication-using-android-studio/ might help to some extent, but they are for older version of Android Studio and they are too complicated.
What you need to do (especially when you start from scratch) is:
Ensure that your key is an OpenSSH key, and that it's a private key (not a public key). This is where the above mentioned instructions are misleading - they point to the key in supposedly Putty format (the .ppk file), and this doesn't work. If you have a Putty key, use Putty's puttygen.exe tool to export the private key in OpenSSH format.
Create the config file as described in those instructions. I.e.
create the text file named config in .ssh subdirectory of your user directory. In my case the path would be C:\Users\Eugene.ssh\config.
Put the following to this file:
Host my-host.com
HostName my-host.com
Port 22
IdentityFile C:\Users\Eugene.ssh\my-private-key-for-my-host.openssh
(the original instructions include indentation of lines 2-4, but I couldn't add any indentation here).
Use Checkout Project From Version Control menu item in Android Studio's welcome screen to initiate GIT checkout.
Use the following settings during checkout (curly brackets contain the values which you replace with yours):
Git Repository URL: {projectalias}#{my-host.com}:base/{projectname}
Parent directory: eg. "z:\Projects" The path which must exist, and in which the new project is created
Project directory: eg. "myproject". The directory with this name will be created in Parent directory, so the files will be checked out to Parent_directory\Project_directory, eg. "z:\Projects\myproject".