I set up my Github with android studio, everything worked fine, the problem now is though, that I can't seem to turn off, or get out of version control to use the IDE normally again.
This means that errors aren't shown, and it is really hard to debug because of this.
So how do I turn off version control (VCS) in Android Studio?
To disable VCS in Android Studio on a Mac do the following:
Android Studio > Preferences...
In the Preferences window, select Version Control and under Directory choose VCS dropdown to be <none>
Don't forget to click "Apply" in the general Preferences buttons at the bottom.
For 2022...
It would seem that Android Studio nowadays does not automatically start with version control turned on for a new project.
The default seems to be "off" at the beginning of a new project.
(It does conveniently make a ".gitignore" file for you but it does not default to trying to use version control.)
However, if later you do manually yourself start using git in the folder in question, Studio does turn on vcs inside Studio, i.e. exactly as seen in the image above. In that case you'll have turn it off inside Studio, exactly as shown above.
In Android Studio 1.2.x
FILE -> SETTINGS -> VERSION CONTROL
Here the root is shown, Press (-) button to delete.
The other answers weren't working for me, so I am adding my solution.
This message was driving me crazy:
I had trouble with the other suggestions, as my settings was not allowing me to save changes for version control none.
So I went into Version Control / Ignored Files and removed all ignored files for that project.
Then when I clicked back on Version Control
I found this in this answer here.
VCS is a project specific setting which you can modify by going to File -> Settings then checking under the Version Control heading.
Alternatively, you could disable a specific VCS plugin under the Plugins heading.
Note: I have not used GitHub as VCS, but you should still be getting error display (syntax checking) in the IDE. VCS usage should not disable that, since that would make the use of an IDE completely pointless.
You can delete vcs.xml file and it will remove the VCS connected with your app. 'vcs.xml' file can be found in this location "YourProject\ .idea\vcs.xml"
Project > .idea > vcs.xml
change vcs value to 'none'
Note : only current enabled project.
Related
Android Studio used to have the option to debug existing APKs from the File->Profile or Debug APK. I have used it in Android Studio version 3.4. Now at version 3.4.1, I cannot find it.
Does anyone know if the option was removed from Android Studio or where can I find it?
I had this same issue and here's how I solved it.
I had disabled APK and NDK support in hopes that it would speed up my IDE. I forgot to turn them back on. So I went into Preferences > Plugins and if you don't have them installed, install Android NDK and Android APK support. If you already have them installed, tick Android APK Support and it will prompt you to enable Android NDK Support if you don't have it enabled already.
Since Android Studio menu can be customize, by some way the option has been removed from your toolbar. To add it again go in File -> Settings -> Appearance & Behavior -> Menus and Toolbar
From here open the Main menu -> File -> File Open Actions folders.
Select the Open line, then click on the plus sign on top of the window next to the search bar. Click Add Action... and search for Profile or Debug APK... options.
Apply and you're good to go !
Edit
After some exchanges in the comments we fixed the issue another way.
You have to go into Settings -> Plugins first. Check if you have the plugin Android APK Support activated/installed. If not then install/activate it.
And now you're really good to go !
That's weird because I am using android studio 3.4.1 and its there:
When I had problems after updating android studio all I did was to re-install it and my problems got fixed.
Also, you should know that downloading another version of Android studio is really user-friendly, check my question about it.
At office, I am behind a proxy. The internet access is restricted.
So I performed a gradle sync at home and copied the folder ".gradle" present at C:\Users\username.gradle from my home PC to the same location on my office PC.
Now on my office PC, I set gradle in Android Studio to "Work Offline" but still whenever I try to perform a gradle sync, I get an error stating
Error: Could not download google-services.jar (com.google.gms:google-services:3.0.0): No cached version available for offline mode
However on digging through the ".gradle" folder I was able to locate the google-service.jar file at
C:\Users\username\.gradle\caches\modules-2\files-2.1\com.google.gms\google-services\3.0.0\32b833222c886ecfb37d79b1a05ce1eddb702db1
I am not sure how to proceed. Please help.
I had to dig for this a long time in the 2019.2 version. This option has moved in the UI. It is now in the toolbar of the gradle tools:
see JetBrains documentation at https://www.jetbrains.com/help/idea/jetgradle-tool-window.html#offline
This Error occurs when in your Android Studio's Gradle Tools Offline Mode option is Enabled.
When Enabled it lookes like this.
To fix it, you can Disable mode by clicking on the option shown in below screenshot.
> Update: I heard Google Listened to the suggestion! and now in new android studio versions, when you start a new project, a popup will come with option to either build with gradle online or offline.. Great for you all..
You need to re-enable your gradle online mode
Google changed the location of doing this...
After the latest version as at this time i am typing this answer, which is version below
Android Studio 3.6.1
built on February 27, 2020
I have sent a message to the them so Google changes this in next update..Cos the new location confuses the Software engineers who are used to the old way of doing it...
But for now follow these clear 2 steps to find it and toggle it Online or Offline easily..
Just Go to the top-right hand corner of your SDK and click the vertical Gradle tab as circled in red in the my picture below...
Then you Click this icon (which looks like a symbol in an electrical schematic circuit) on the gradle table that comes out.. As Circled in Red in my picture below..
Maybe helps someone. Just remove --offline in "Command-line Options:"
click on gradle on the right
toggle offline mode
try again (sync with gradle files)
It seems that in newer versions of IntelliJ (I am on 2018.1) you may need to uncheck the Offline checkbox in Gradle preferences.
Just for reference 2019.1 Ultimate IntelliJ, go to Gradle -> Settings (a top-rightmost icon) -> Uncheck the Offline work in Global Gradle settings.
Gradle Tab not presented, go to View -> Tool Windows -> Gradle to show it first.
I'm using android studio in MacBook
step 1 - Go to preferences by clicking android studio on the left
uppermost corner.
step 2 - Go inside Build,Execution,Deployment.
step 3 - Finally select Gradle.
step 4 - then, uncheck offline work. Click apply then ok.
step 5- lastly try to sync once again.
Hope this will work because it works for me.
You can set startParameter.offline=false in your settings.gradle
Try running gradle with the --debug flag, in addition to the --offline flag. That will tell you exactly where it's looking for the files.
One possible reason for the error is that the path of the .gradle folder is different between your home and office PC, possibly because your username is different on each machine. The .gradle cache uses absolute paths (see .gradle/caches/modules-2/metadata-2.16/artifact-at-repository.bin for an example). This is a documented Gradle issue: https://discuss.gradle.org/t/copying-the-gradle-cache-to-another-machine/7546/13. If possible, use the same GRADLE_HOME at home and work to resolve the issue.
How to configure gradle to work "offline" (using cached dependencies)
Uncheck the 'Offline work' under the Global Gradle settings fixes my issue.
Unregistered VCS root detected
The directory /Users/*****/AndroidStudioProjects/Signin/google-services is under Git, but is not registered in the Settings.
Add root Configure Ignore
How to resolve this?
Please help.
Press "add root" when the warning message appears.
This will make idea register the "unregistered vcs root", and you can use the git features of IDEA/Android studio. Nothing bad will happen if you do not press "add root", but I suspect you will get the same warning on each startup of android studio/IDEA.
You are able to ignore that warning if you are not interested in using Android Studio's git integration. Or, you can enable git integration under the VCS | Enable Version Control Integration menu.
VCS stands for "Version Control System", aka "undo on steroids". No programmer should be without it.
IDEA (which Android Studio is based on) sees some signs in your project directory that your project source is set up to use a Version Control System.
In this case, the VCS in use is git. The sign is the presence of a projectdir/.git subdirectory.
That indicates that you either created this project directory by "cloning" this project from a git repo:
$ git clone https://github.com/projectname/reponame.git
Or that you created your own git repo in the project directory, by cd'ing to the projectdir and running the command:
/path/to/projectdir $ git init-db
By clicking "add root" you tell IDEA to add this git repo to IDEA's internal settings for the project, so you can use the IDEA features that support using git. I recommend using it, it won't interfere with your ability to use git from the command line, but some of the IDEA git features are handy.
If you don't know/use git, I highly, highly recommend that you learn it. It will make your life a lot easier, in the long run. As I said, it's like "undo" on steroids.
If you already know how to use git, here are a few of IDEA's git features.
The niftiest feature is that you can select a few lines of code, right-click and select Git/Show History for Selection.
The most useful feature (to me) is Alt-9 aka View/Tool Windows/Version Control.
This brings up the version control window, a pane across the bottom of the
IDEA gui.
By default the Version Control Window just shows "Default" (in bold)
and "Unversioned Files".
Expand "Default" to see the files that changed.
Expand "Unversioned Files" to see any files that need to be added to git.
The color indicates the status, all configurable of course, the default config is that blue indicates changed, green indicates added, etc.
Right-click/Show Diff on a changed file and it gives you a nice visual
diff, sort of reminiscent of Meld's UI, which is one of my favorite,
because it uses these sort of cartoon "word ballon" indicators for
each difference, to illustrate where the difference would be in the
other version.
Also, the side of the visual diff that shows the current file appears
to be a fully functional (or mostly functional) IDEA editing window,
making it easy to fix any gratuitous differences.
Some useful related links:
https://www.jetbrains.com/help/idea/2016.1/file-status-highlights.html?origin=old_help
Also, at the same site see:
Howto/General Guidelines/Version Control with Intellij IDEA/VCS-Specific Procedures/Using Git Integration/Checking Git Project Status
Reference/Version Control Reference/File Status Highlights
I'd include links directly to these but apparently stackoverflow doesn't trust me yet.
You can disable Android Studio git integration and get rid of the annoying warning. Here's how with Android Studio 2.1.1 for the Mac OS X:
Menu -> "Android Studio/Preferences...".
In Preferences window: Click on to open "Plugins"
In the Plugins frame: uncheck "Git
Integration".
Disabling "Git Integration" also disables GitHub, Google Cloud Testing, Google Cloud Tools Core, Google Cloud Tools For Android Studio plugins. (good riddance). By default, Android Studio enables all plugins at install time even though most devs will use only 10% of them.
FIRST STEP: Click in configure link.
SECOND STEP: then select the correct and add
If you see this message whenever you open Android Studio and create a new project, It's because your projects home directory is set as a VCS root. Maybe It was a mistake, set by you unintentionally. That was my case.
To solve it.
Just delete .git directory from projects home directory.
Delete: ../AndroidStudioProjects/.git
My drawables in android studio are turning red and are not displaying. Does anyone know what could be causing this?
It appears you have Version Control Integration enabled, and those files simply aren't added. If you open the Version Control panel, you should see "Unversioned Files". Expand that, and you can right-click and select "Add" to add them to your version control system.
Alternatively, do it on the command line, i.e. if you're using git:
git add <path-to-file>
Unregistered Vcs root detected
The directory C:\Users\Andrew is under Git, but is not registered in the Settings.
Configure Ignore VCS root errors
Why is this showing ?
This occurs because Android Studio has detected that you have git projects imported but they have not been "registered" to track their status in Android Studio. Your project will not be negatively affected if you choose not to configure this, IntelliJ only prompts you because it has some integrated version control features that will not be able to function.
So if you want to take advantage of ItelliJ's built in version control options or just get rid of an annoying warning, its an easy fix.
Just register all of the projects you want to have the version control IDE integrations for in the Preferences > Version Control section. You should see this screen:
The UI is a little confusing, but all you need to do is select one of the directories under the Unregistered roots: section and then click the + button in the lower left corner of the window. If you have added all the directories you should see the Unregistered roots: disappear and you should no longer receive this warning.
You can select each directory and use the + and - buttons to determine which projects should use VCS in Android Studio
In the error message you have the options "Configure" or "Ignore". Click "Configure".
Settings window will open. Click the "Add root" option. In my case I only had one path on the list to choose from. I selected that path. Please see the image I have included below.
Click Apply, then click OK.
Look for "Version control" in preferences and set up what VCS should be used:
You have to set this up in order to access function like revert, commit etc from the IDE.
See also, the documentation on Version Control
For me, just VCS -> Enable Version Control integration did the trick. Having used IntelliJ in the past (Which is much similar to AndroidStudio, the latter is modeled after the former I believe), I've noticed the version control has to be enabled for each project when it's created/imported.
Steps are given below to sort out this issue:
Click on Configure option
Select Directories under Unregistered roots
Hit + button at the right side of pane.
And you are good to go.