Bitbucket with android :"Can't publish part of repository" error - android

I have recently use Android studio and I was just try to connect bitbucket with it.
I don't want manually bitbucket by terminal thas why I googling it. find some links link .
I have follow all the steps install plugin>shareproject>login>private>share project
and than error. I checked my bitbucket but no repositary created.
Can't publish part of repository
Invalid VCS root mapping The directory
ExpandableLayout-master\TestProject is
registered as a Git root, but no Git repositories
I don't know is thare error of plugins of bit bucket or my android studio

After to much research... finally i got answer
Actually it is bug of bit-bucket plugin. bit-bucket bug
Here is solution given by AKAMUZA in above link thanks bro.
(1)Go to project folder and delete .git folder
(2) IDEA pops up an error message about project not being under version control and an option to configure it. Press Configure and just delete the path to your project in VCS section.
(3)After this Import into version control -> Share project works like a charm.
UPDATE
I Found many developer having issue after use plugin directly from Android studio and if It not work you can download below plugin
https://bitbucket.org/dmitry_cherkas/jetbrains-bitbucket-connector/downloads/jetbrains-bitbucket-connector_IC-139.224.zip
Go to Setting-> Plugin-> Install plugin From disk ->above downloaded plugin -> install & resatart.
You can feel Magic after restart :P

I have the same problem with android studio.
this is my suggested solution:
go to project root folder
then open a terminal in this folder:
git init
git add --all
git commit -m "your message"
then go to bitbucket and create new repository then choose "I have an existing project" ...
Now you can use plugin to push/update

This thread mentions (assuming that File > Settings > Version Control is set to "git"):
You could instead have navigated into the directory via a terminal or shell and typed 'git init'. That would have converted that directory into a git repository.
So check if ExpandableLayout-master\TestProject has or has not yet a .git subfolder in it.
If not, it means you have declared that path as a git repo, but locally, on your disk, that folder is not yet a git repo. If so, you can initialize it, add a remote pointing to an empty bitbucket repo and push.

Related

How do I download a GitHub repository to an Andriod Studio project that I am currently working on?

I am working on an Android Studio project and I would like to add a getup repository to the current project. I am using a Mac.
I have downloaded the Github repository and unzipped the folder and was able to create a NEW project using the GitHub repository in Android Studio, but I do not know how to either
A) merge the two projects in Android Studio so my initial project can use the new GitHub Repository Project.
or
B) if I did this process incorrectly and I need to add the GitHub repository directly to my initial Project. I just don't know how and I have looked everywhere for the answer. Any assistance would be fantastic.
I found this answer about merging projects, but I do not know where to find my projects "module root"
You may refer to these 2 links, 1 and 2 for elaborations.
First of all, open the project you want to push in Android Studio.
Click VCS -> Enable version Control Integration -> Git
There doesn't seem to be a way to add a remote through the GUI. So open Git Bash in the root of the project and do git remote add
Now when you do VCS -> Commit changes -> Commit & Push you should see your remote and everything should work through the GUI.
If you are getting the error: fatal: remote already exists that means you already added it. To see your remotes do git remote -v and git remote rm to remove.
You may also refer to here and here for more understanding.

How do I connect GitHub Enterprise in Android Studio? [duplicate]

This question already has answers here:
How do you synchronise projects to GitHub with Android Studio?
(13 answers)
Closed 5 years ago.
I have a project in Android Studio. I want to add that project to a GitHub repository using android studio. How can I do that?
Sign up and create a GitHub account in www.github.com.
Download git from https://git-scm.com/downloads and install it in your system.
Open the project in android studio and go to File -> Settings -> Version Control -> Git.
Click on test button to test "path to Git executables". If successful message is shown everything is ok, else navigate to git.exe from where you installed git and test again.
Go to File -> Settings -> Version Control -> GitHub. Enter your email and password used to create GitHub account and click on OK button.
Then go to VCS -> Import into Version Control -> Share Project on GitHub. Enter Repository name, Description and click Share button.
In the next window check all files inorder to add files for initial commit and click OK.
Now the project will be uploaded to the GitHub repository and when uploading is finished we will get a message in android studio showing "Successfully shared project on GitHub". Click on the link provided in that message to go to GitHub repository.
You need to create the project on GitHub first. After that go to the project directory and run in terminal:
git init
git remote add origin https://github.com/xxx/yyy.git
git add .
git commit -m "first commit"
git push -u origin master
If you are using the latest version of Android studio, then you don't need to install additional software for Git other than GIT itself - https://git-scm.com/downloads
Steps
Create an account on Github - https://github.com/join
Install Git
Open your working project in Android studio
GoTo - File -> Settings -> Version Controll -> GitHub
Enter Login and Password which you have created just on Git Account and click on test
Once all credentials are true - it shows Success message Or Invalid Cred.
Now click on VCS in android studio menu bar
Select Import into Version Control -> Share Project on GitHub
The popup dialog that will occur contains all your files with check mark, do ok or commit all
At next time whenever you want to push your project just click on VCS - > Commit Changes -> Commit and Push.
That's it. You can find your project on your GitHub now.
First of all, create a Github account and project in Github. Go to the root folder and follow steps.
The most important thing we forgot here is ignoring the file. Every time we run Gradle or build it creates new files that are changeable from build to build and pc to pc. We do not want all the files from Android Studio to be added to Git. Files like generated code, binary files (executables) should not be added to Git (version control). So please use .gitignore file while uploading projects to Github. It also reduces the size of the project uploaded to the server.
Go to root folder.
git init
Create .gitignore txt file in root folder. Place these content in the file. (this step not required if the file is auto-generated)
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.idea
.DS_Store
/build
/captures
.externalNativeBuild
git add .
git remote add origin https://github.com/username/project.git
git commit - m "My First Commit"
git push -u origin master
Note : As per suggestion from different developers, they always suggest to use git from the command line. It is up to you.

how connect myProject to mainProject on github (Android Studio)

in the past, I did not download the telegram source with the git but now i need update my source and I need connect myProject (my Unofficial Telegram), to mainProject (Telegram) on github. my IDE is Android Studio. git in Android Studio is in VCS menu. but I do not know what to do, for conect my project to github project.
Make sure you have git installed on your system. If not, go to this link and download it
https://git-scm.com/download/win
Right click inside your local project folder and select 'Git Bash Here'
(If you want to clone your entire GitHub project into your local project, do it by typing:
git clone https://github.com/DrKLO/Telegram.git
If you already have the files and you just want to update it, skip this cloning step)
Check if your project folder has .git folder in it. (Check the hidden folders too) If there isn't one, type the following in your GitBash window
git init
Add the link to your GitHub (remote origin) by typing
git remote add origin https://github.com/DrKLO/Telegram.git
Update your files with the GitHub source by typing
git pull origin master
If you just want to know how to connect your project in Android Studio to GitHub, here's a simple tutorial:
https://www.londonappdeveloper.com/how-to-use-git-hub-with-android-studio/
(Skip the steps where he creates a new GitHub repository and an Android Studio project, since you already have both)
For detailed understanding on using git and github, i suggest you take this course:
https://in.udacity.com/course/how-to-use-git-and-github--ud775

invalid root mapping github project

invalid root mapping androd
i have download a project from github and open it in Android Studio it showing following error see image..
Check weather in the folder there is an hidden folder named .git that is supposed to contain the git information. If it's not there that is the problem.
Anyway other then that you could probably try to save as backup the current directory and clone it again in a new folder so that you can check if everything is the same.
If you have git in your shell (and I suppose you do since you are on linux) it's really easy, just try something like:
git clone repo_url
Says that the project android studio go configurations are incompatible. Either try to use the project with the git clone option, or delete the hidden .git extension.
The error happens because Android Studio found a remnant of git (something like .gitignore) in the project directory but not found any .git folder in the project. So it complaining that the project is supposed having a .git and giving an optional to create and set the root directory as a project with git. Other then that, you can work with the project without any problems.
When you downloading the project from the github via clone or download -> download ZIP, you will losing all the git files of the project. So you losing all the history of the project which is in the git. Instead download ZIP, you can clone the project with:
git clone remote_project_file
When you clone your project from git make sure you do (forgetting the recursive flag usually causes the vcs root mapping problem):
git clone --recursive YOUR-GIT-URL
or if you have already cloned then to fix it:
git submodule init
git submodule update

Getting "Repositroy test has failed" error while cloning repository from Gitlab in Android Studio?

I will like to clone my android code from gitlab repository in Android Studio 0.8.1.I checked into VCS >> Checked out from Version Control >> Git >> Added HTTP url here.It prompts me that "Repositroy test has failed".Kindly help me to sort out the issue.I have checked the plugins as well.Thanks a lot.
You need to download and install git from http://git-scm.com/downloads
Then you need to track the git.exe on AndroidStudio:
Go to Settings > Project Settings > Version Control > VCSs > Git > Path to Git executable
Select (or type) executable path, eg: D:\Program Files (x86)\Git\cmd\git.exe
If you installed GitHub Desktop for Windows
In case you have GitHub Desktop for Windows, git.exe will be found at C:\Users\YOUR_USER_NAME\AppData\Local\GitHub\PortableGit_c7e0cbde92ba565zz218z5214zzz0e854zzza28\cmd.
If you Installed git from http://git-scm.com/downloads and also sett the correct path and still get an error maybe you sit behind a Proxy, in this case you have to add the Proxy to the git. This is Possible in the gitconfig. Wich should be avaiable in :\Program Files (x86)\Git\etc if you used the standard path for installation.
I am on Ubuntu 16.04 (this applies to other versions as well) and all I needed to do was to install git from apt-get:
sudo apt-get install git
This means Android Studio was trying to execute git command but it could not be recognized so if you have git installed then try to execute git from terminal and if not recognized then you should configure paths to git executable. That was it!!!
Just to add to Sree's answer, I was getting this error even after installing Git, but the problem is that I didn't install it to the default installation folder.
After choosing the right path and folder in the VCS settings tab, it worked beautifully.
I opened the HTTP URL in browser, that my collaborator sent me:
https://github.com/mansonpeter/GoUpApp/invitations
for download and join the developing team, there was an accept button, after accepting hopefully the error gone, repository test was successful and I got the project in android studio. before this I had tried all the suggestion on this page and non of them was efficient.
Try unchecking the "Clone git repositories using SSH".
I'm in Linux, At first check you have the appropriate certification to know this you can clone the repository in terminal if you get error similar this
fatal: unable to access 'https://YourDomainName/Project/GitRepository/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
then open your domain in browser and click on lock in the left of url go to detail and press export to save the certification and finally copy the content of the file and pase it into
/etc/ssl/certs/ca-certificates.crt
For me this solution for the issue worked.
Goto Settings > Version Control > Git and set SSH Executable to "Native" instead of "Built-in". Then restart your IDE for settings to apply.
Worked for me in all jetbrains IDEs.

Categories

Resources