Error running git"Cannot run program "git": error=2 [duplicate] - android

This question already has answers here:
Android Studio Checkout Github Error "CreateProcess=2" (Windows)
(9 answers)
Closed 7 years ago.
I have this error on my Android Studio running with Mac OS 10.8.3, I've installed the github client but is not necesary...
Any help?
Thanks

Within terminal you can find your git install directory with:
git --exec-path

Check the path registered in Settings -> Version Control -> Git, in text box next to "Path to Git Executable".
It should reference a local installation of git.
If the path mentioned there doesn't exist, that would explain the error message.

Use your terminal and check the following.
1) Check if you have installed git
git --version
You should see something like
git version 1.7.9.5
If not, there could be an error in Git installation
2) See if a .git file exists in the directory you want to push to the remote repo.
cd <into your directory>
ls -altr
You should see a file with the name .git.
This is the file that git will use to track the repo details.

Related

The android sdk location cannot be at the filesystem root

I have installed Android Studio in the F:\ drive. My Flutter project is in the E:\ drive.
The Flutter plugin is installed in the Android Studio. But when I open my project in Android Studio and I go to the SDK Manager, it shows the following error:
The android sdk location cannot be at the filesystem root
Every package is disabled and the checkboxes are disabled, so I cannot click them to install Android SDK. The "Edit" link next to the error is not working either.
I came with the same problem because of forgetting "sudo"
Using the new android studio (bumble bee version) .
Restart the app and make sure you have an internet access
That will be enough to create the SDK and it’s directories
Just press Edit ( It is clickable) then download and install the required components.
Download the SDK first, and restore the default settings.
You can find the "Restore default settings" feature here.
What you can do is that you click on edit to surely you will get some version of Android that installs it by default and you click on next it will open another configuration verification window and you click on the next one for last it will tell you or It will update the version of android that was downloaded by default and you click again to finish and you can just select other versions of Android. That worked for me. Linux Ubuntu 20.04.4 LTS
Step 1:
Step 2:
Step 3:
Step 4:
Ready!!
For me it was the system language on Windows, I have changed it to English and it worked.
TL; DR
Make sure:
Your user has write permission into Android SDK directory.
ANDROID_HOME is correctly defined with the correct SDK location.
Description
IMHO it is a really bad practice install SDK into user home directory because:
Packages added will be restricted to a single user.
System administrators won't be able to mirror OS images, thus each engineer will have to install SDK manually.
The old school way is according to Linux directory hierarchy as described at The Linux Documentation Project, which consists on:
Ensure your user has adm privileges
Export SDK environment variables
Obey the filesystem hierarchy, installing the IDE and SDK into /opt
The steps above work perfectly on Ubuntu 22.04 and shall work on other distros with minor adjustments.
1. Ensure your user has adm privileges
grep adm /etc/group | grep ${USER}
adm:x:4:syslog,ventura
lpadmin:x:122:ventura
2. Configure environment variables
/etc/profile.d/
├── ...
├── android.sh
├── ...
├── java.sh
└── ...
where android.sh contains
#!/usr/bin/env bash
export ANDROID_HOME=/opt/google/android/
export FLUTTER_HOME=${ANDROID_HOME}/flutter
TOOLS=${ANDROID_HOME}/platform-tools
TOOLS=${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/tools:${TOOLS}
export PATH=${FLUTTER_HOME}/bin:${TOOLS}:${PATH}
and java.sh your JRE directory
#!/usr/bin/env bash
export JAVA_HOME=/usr/lib/jvm/java-18-openjdk-amd64
3. Install Android Studio and Android SDK
Download latest Android Studio and unpack it into /opt/jetbrains/:
VERSION=2021.2.1.16
sudo mkdir -p /opt/google/android
sudo mkdir -p /opt/jetbrains/studio
# Unpack Android Studio into a versioned folder
tar -xvzf android-studio-${VERSION}-linux.tar.gz
sudo mv android-studio /opt/jetbrains/studio/${VERSION}
# Grant write permission to administrators
sudo chown root:adm -R /opt/jetbrains/
sudo chmod g+w -R /opt/jetbrains/
sudo chown root:adm -R /opt/google/android
sudo chmod g+w -R /opt/google/android
Finally launch Android Studio and choose the SDK location:
This approach is extremely powerful because it allows system administrators duplicate development workstations using rsync -avz without relying onto any username or custom privileges.
I searched for many hours for an answer to this
I reinstalled:
I opened a new folder called Android in C:
Into it I reinstalled the android studio
You have created a new SDK folder within it
Then in the blank path, I entered C: \ Android \ sdk
And that's how it all worked.
Try it!
You can clear invalidate caches and restart android studio like follow picture:
Then start download sdk files :)
Make sure that your internet is working and try to close VPN connections if you have any. Then restart Android Studio and hope for the best.
To solve this issue, I had to close Android studio entirely. When I started the application again, it detected that it had a missing SDK problem and then went ahead with the installation process for it.
Your country should not be among the sanctioned countries (using VPN).
Android Studio by Run as Administrator open.
Download : Android SDK and Android SDK Platform.
Fix error: the android sdk location cannot be at the filesystem root.
For test The VPN is working properly.
Open website : https://developer.android.com/
this is the best solution to this error which is just under any drive you have on your laptop which C:// open a folder called "Android" and under the android folder open a folder called "sdk" and change the sdk file path to this recently created folder. That's All.

How to open Android SDK manager from terminal? [duplicate]

This question already has answers here:
Android SDK manager won't open
(29 answers)
Closed 8 years ago.
I have CD'd into my android tools directory in the terminal. I tried typing 'android' and hitting enter and I also tried typing 'android sdk' and hitting enter but the sdk manager would not come up.
Any solutions or advice to help me understand what I'm doing wrong?
From outside the tools directory (obviously, you need to change to suit your path taste):
$ sudo /opt/android-sdk-macosx/tools/android
From within the tools directory (note the leading dot and slash):
$ cd /opt/android-sdk-macosx/tools/
$ sudo ./android
Related: you should have both ANDROID_SDK_ROOT and ANDROID_NDK_ROOT set in your environment. ANDROID_SDK_ROOT is used by the (now deprecated) ddms program. ANDROID_NDK_ROOT is used by various NDK tools. See Recommended NDK Directory? on the Android NDK user list.

android studio commit changes on Team services/tfs

I am using Team foundation services to upload android studio projects on TFS server
I the project is added successfully to server using
VSC -> Import into version control -> Import into Team services git
But when i tried to change any code in the activity and click VSC -> Commit changes a pop up message return no changes detected why??
Please try below items to narrow down the issue:
Try to run command $ git status (You need to install Git bash to run the command under the repo) to check if there are any error
messages there. If get the error like this : bad index file sha1 signature, fatal: index file corrupt. Just try to delete the index
file, then reset with below command (Reference this thread :How to resolve "Error: bad index – Fatal: index file corrupt" when using Git):
del .git\index
git reset
To run the command : Install Git bash >> go to the git repository and right-click the project folder >> Git bash here >> Run the command in Git bash.
Go to the file you have changed and Right Click >
Synchronize, then it will check against the last one manually. The commit again.
For Android studio with Git, you can reference Version Control System using Git on Android Studio.
I uninstall the Git and re install it again also i started from zero to upload the projects and commit works fine

How to open then the Android SDK Manager through the terminal? [duplicate]

This question already has answers here:
Android SDK manager won't open
(29 answers)
Closed 8 years ago.
I have CD'd into my android tools directory in the terminal. I tried typing 'android' and hitting enter and I also tried typing 'android sdk' and hitting enter but the sdk manager would not come up.
Any solutions or advice to help me understand what I'm doing wrong?
From outside the tools directory (obviously, you need to change to suit your path taste):
$ sudo /opt/android-sdk-macosx/tools/android
From within the tools directory (note the leading dot and slash):
$ cd /opt/android-sdk-macosx/tools/
$ sudo ./android
Related: you should have both ANDROID_SDK_ROOT and ANDROID_NDK_ROOT set in your environment. ANDROID_SDK_ROOT is used by the (now deprecated) ddms program. ANDROID_NDK_ROOT is used by various NDK tools. See Recommended NDK Directory? on the Android NDK user list.

Repo in CYGWIN got error like "Python can not open file 'user/bin/repo'"

I have Windows 7 on my pc and I just wanna check out the Android source by following the steps here:http://source.android.com/source/downloading.html
I tried CYGWIN and followed exactly what the tutorial told.
But got no luck here:
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1
CYGWIN bash told me this:
C:\Python27\python.exe: can't open file '/home/qhuang/bin/repo': [Errno 2] No such file or directory
Actually this file exists and it may need a prefix:
C:\cygwin\
in windows.
Big thanks to anyone helps!
To help out anyone who (like me) hits this question later on. This was solved for me after installing python within Cygwin (I had python installed in Windows, but not Cygwin). You can check if it is installed with 'which python' if it comes back as C:/blah/python then you don't have it installed in Cygwin; you want /usr/bin/python to come back letting you know it is the internal Cygwin one.
Try cd C:\cygwin\ , maybe that helps

Categories

Resources