I am using Android Studio 2.0 Beta 6 on Ubuntu GNOME. I am facing a strange problem. I am using git version control in my Android project. After building the project, when I click on commit changes through Android Studio GUI. The commit changes dialog box shows every file as changed. When I click on any file, it says contents are identical. I am attaching the screenshot below, clicking on any files says contents are identical.
So my question is, Why Android Studio shows files with identical changes in commit changes dialog and how can I solve it? I tried google but didn't found any related question.
It must be because of automatic file encoding changes by the IDE (In case you imported the project from somewhere else). Sometimes IDEs apply them automatically. Just revert the changes and do a clean and build. If the changes appear again, you will need to do a commit once and after that you'll be allright.
To verify you can just go to a normally behaving file. Open it in notepad and just save as from notepad with another encoding. It should show as modified thereafter in the version control window.
For me it was AS pointing to old git version. Please check the Settings\Version Control\Git
I ran into this issue as well. None of the typical culprits seemed to be at fault. As far as git (from the command line) was concerned, the files were unmodified, yet Android Studio still showed them as modified.
It turns out Android Studio and my command line terminal (cygwin) were using two completely different Git binaries. Android Studio was pointing to a Git installation I had made at some point in the past, while cygwin was pointing to /usr/bin/git, which had come from Cygwin's Git package.
I edited Android Studio's version control settings (as shown in Anton's screenshot) to point to the git.exe within my Cygwin distribution, then did a "refresh file status" from the VCS menu, and all the files went back to showing as unmodified.
Related
I code something in android studio and it works.
I closed the program and when i open it again the project is filled with errors and its files (the ones mentioned in the headline) have changed completely which it can not run the code itself. Sometimes i even get things that are not even ASCII characters.
In the code itself(Java) i can no longer create TextInputEditText.
Well for the gradles i have created a new project and copied the gradles from those and put them there.
For the drawables i had to re-upload them, re-convert them to PNG (although they already were) and i had to re-write xmls.
I just need to know what's causing such malfunction.
AFAIK, whenever you open a code in Android Studio, maybe you are clicking on upgrading Gradle version, and it changes some gradle files.
And you need to add your drawables manually to the GIT and make sure those are uploaded, to the repo, make sure your .gitignore does not include PNG.
What I would say, is open virtual box, install a fresh Ubuntu system and Android stack with Android Studio. Now git clone your repo, and upgrade your gradle and all the build.gradle dependencies. Now remove all those ASCII characters. Also make sure, your keyboard language is US English and generally the OS is also in English.
I was working on an Android app, and decided to do an initial git commit. The project folder was on my desktop so I moved it into a newly created folder as to not make the Desktop into a git repository. The project was open in Android Studio when I moved it and made the commit, and when I went back to it it didn't work.
I closed it and reopened it and it wouldn't compile (I was a fool and didn't screen shot the error message) but then it started to work.
However, all the files in the project are in red, not the code itself, just the files that a visible in the tab on the left and the tabs at the tops of the open files. The project works but I want to get rid of the red as obviously it's an indication that something's not right.
I have to send this project for review tomorrow and I hope this won't create an issue for the recipient.
Thanks
The files are red because they have not been committed to git.
git add . and git commit -m "your commit message" should fix it.
And No it should not be a problem. I suggest you read more about git, it's a cool tool
I'm working on an Android project for my company.
Here is my current development setup:
Android Studio (version 2.3)
GitKraken (version 2.1.0)
Ubuntu (version 16.04)
As I make improvements to my project in Android Studio, I use GitKraken to review my changes and commit them to GitHub. Nothing out of the ordinary.
My problem is that every once in awhile, files will be committed directly to my 'master' branch and pushed directly to GitHub - without me doing anything. The files that are pushed are configuration .xml files that I haven't changed. This is very frustrating, for obvious reasons. The commit message that is generated usually looks like:
AI-2.3 trent#trent-Lenovo-Yoga-3-14 Create hg.xml
I have deleted my 'master' branch completely (local and GitHub), and created a new branch called 'stable' to take it's place. That didn't work, as these 'auto commits' simply create 'master' branch again and push it to GitHub.
I have also turned off VCS settings in Android Studio. I cannot find any setting in GitKraken would be doing this - to my knowledge, anyway.
I'm hoping that I'm unaware of a simple setting that can stop this behavior. I've searched for similar issues on Google, Android Studio forums, and Stack Overflow, with no luck.
Please let me know if you have any questions.
Got the same problem with Android Studio 2.3.3 and Ubuntu 16.04.
The problem occurred after Android Studio (AS) glitch when it lost my private IDE settings.
Solution: look into dir ~/.AndroidStudio2.3/config/settingsRepository (take notes that .AndroidStudio2.3 is hidden dir). In my case, there is repository dir that contains my Project plus all that wired additional setting files that been added to my GitHub master branch every time I've Push. Just delete that repository dir.
Looks like AS use its own source control system on top of Git. As I can see some people even use it for backing up their settings:
https://github.com/kakkoyun/android-studio-settings
https://github.com/xinthink/android-studio-settings
Didn't go dip into the problem, just solve it for my case. Would be good if any Expert explain that strange Android Studio behavior in more details.
Also related to Android Studio keeps adding additional files to GitHub
The problem
I have a strange problem with SpringSource Tool Suite 2.9.1 Release and Subversive plugin, running on Windows 7 Home Premium x64. I'm trying to checkout an android project from an SVN repository.
Here's what I'm doing:
File > Import > SVN > Project From SVN
I fill in the path to my repository and check the HEAD revision
I click Finish
The project is found and the default option is Check out as a project with the name specified. I leave the name alone Set the Depth field to Recursively and again, select the HEAD revision.
I click Finish
A progress bar appears for a second just to show an error message:
Checkout operation for 'https://(.....)/Android' failed.
svn: Cannot create new file 'C:\workspace-sts-2.9.1.RELEASE\AppName \.svn\lock': System can not find the path specified
When I retry and follow the steps from 1 to 6, another dialog appears. It says:
This project already exists in the workspace
or there is a data folder in the checkout destination.
It allows me to select a folder to overwrite. When I do that, a similar but different error message is shown. It says:
Checkout operation for 'https://(...)/Android' failed.
0x0000000f: The folder 'C:\workspace-sts-2.9.1.RELEASE\AppName \.svn' is locked by some external process. Please unlock the folder and try to check out the project again.
What I've tried
First, I opened the SVN Lock view to see if there were any locks created by the IDE. There were none.
I restarted the computer, hoping it would solve the problem of any application locking the file but this does not seem to be the case.
After that, I created a new workspace in a different location and tried to check out the project in there. The result was the same.
Then, I attempted to change the version of SVN Kit. The situation persists in:
SVN Kit 1.2.3
SVN Kit 1.3.5
Native Java HL 1.5.4
Native Java HL 1.6.12
I thought that changing permissions to the directories of my workspace was worth giving a try. It didn't do the trick either.
Finally, I checked out the project in a different location, using Tortoise SVN and imported it into my workspace. I could run it (though some build path settings seemed to be missing) but it's not a solution. I can't possibly imagine working on the project simultaneously with a couple of people without the ability to commit/update/view history/resolve conflicts in my IDE.
I was advised to install a separate version of eclipse with its own set of tools and a different workspace for this application alone but it doesn't seem like a good idea. I'd like to keep it all in a single IDE. I'd also prefer to avoid reinstalling the whole thing as I don't feel like configuring all the other tools (mostly spring and android-related) from scratch.
Has anybody seen a situation like this? How can I get it working?
It's uncear to me whether this is a subversive problem or an SVN problem. I would try checking out from the command line (you must install SVN command line tools to do this, but I'd recommend having the tools around as a backup anyway).
Checkout from the command line and then import into STS using File -> Import -> Existing projects into workspace. Once in the workspace, you can select the project -> Team -> Share project to get svn support on it.
Rename the project and check out again , It must be a problem where u are trying to checkout the project which already exists with same name in the Package Explorer
I'm new to Android & Eclipse. I've downloaded Eclipse and the Android ADT and created an ultra-simple Hello World app (has only auto-generated .java and .xml files).
Eclipse CRASHES (closes after a very brief pause) when I do the following:
In Package Explorer, select AppName/res/layout/main.xml
Press , or double-click, or 'Open With' then 'Android Layout Editor'
(The app runs OK in the Android emulator)
My configuration is:
Android Development Tools 0.9.5.v200911191123-20404 com.android.ide.eclipse.adt.feature.group
Eclipse IDE for Java Developers 1.2.2.20100216-1730 epp.package.java
Windows XP
Can someone tell me what I'm doing wrong or what's wrong with my configuration?
Any suggestions on what to check? For any non-trivial app development I need to
be able to use the Layout Editor.
More ... I can select main.xml and Right-Click and 'Open With' any of: XML Editor,
XML Schema Editor, Text Editor -- with no problem. The problem is limited to Android Layout Editor.
THANKS!
I found the problem.
I discovered the .log files (under \Android SDK\eclipse-java-galileo ...\eclipse )
These files are apparently created by Eclipse when a fatal exception occurs. Upon examining the latest file I saw
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d2521e1, pid=9156, tid=13952
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_02-b09 mixed mode)
# Problematic frame:
# C [fontmanager.dll+0x121e1]
and when I looked further, found the folder where fontmanager.dll resides.
Deducing that 'fontmanager.dll' was part of the Java runtime, I saw that I'd been using jre1.5.0_02, and, upon checking the Sun site, discovered that it's an outdated file. So I downloaded (from Sun site) and installed the latest version of the Java runtime.
That fixed it! The Android Layout Editor runs without problems.
THANKS to Nathan for his efforts. As it turned out, his suggestion didn't solve this particular problem, but the info he provided will no doubt be useful.
You have to upgrade your jdk version to the latest version. I found most of the cases online is that the jdk5 made the eclipse crashed and they worked out by upgrade to jdk6. I used jdk6 but the problem existed! At last I download the latest version(jdk7) and the eclipse not crashes any more!
DONT do anything in eclipse while it says "building project" at the bottom right it does this when you load eclipse, and when you run, or add new files.
If you still have the problem, then I cant help you
In case the above answers don't help, this was my resolve:
I had a similar problem where every time I would view the layout editor (even though I was able to see the XML file) Eclipse would crash. I reinstalled Java, updated Java, and I even reinstalled Eclipse with no avail. It turns out that it was a corrupt video driver, nvd3dum.dll. The filename is in the error list.