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
Related
This has recently just started happening. Whenever I make changes on an Android project the changes don't show up on my Github desktop for me to commit and sync. I instead have to commit and push changes from Android Studio itself. The history of my commits from Android Studio show but not recent changes.
Can someone shed light onto why this is happening?
You have to make sure the .git folder and the working tree used both by Android Studio (as shown in those screenshots) and GitHub Desktop are the same.
Try and import in GitHub Desktop the exact path of the repo used by Android Studio.
I'm not sure this is a common issue, I have Android studio installed on my window pc and my mac laptop and on and off I will switch between both.
Just now I was cleaning up my source code and delete a .xml file from the layout folder and I debug using my phone to make sure it is a working before I upload to the server for other programmers to access it.
Later on the programmers said that there are errors in my file and ask me to look into it, so I immediately switch to my mac and try to debug it and I got the error as well. Later found out that I didn't remove the activity call from AndroidManifest.xml for the previous deleted .xml.
To make sure I did not get the wrong version of my build I try again on my window pc with the errors and perform debugging and surprisingly there isn't any error and the emulator run smoothly. How is that possible?
do you use version control aka team, git, subversion vcs. I believe android studio does this automaticaly via vcs on main menu. githubis another form of this concept. When a team works together it is common to have a local copy of source code and a remote repository on a server. You also may have different branches or versions of the local and/or remote source code. If you find out what version control you use and you still need help post a comment back.
By the way android studio is now using gradle so you can now have free and paid flavors of the same app and i can see that could cause problems.
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.
I have recently created a new Android application and have used its VCS to integrate with GitHub. My problem is that although the integration appears to work, the only file in my Android application that has been saved to GitHub is MainActivity.java. I have tried to add files into GitHub but via the Website but this fails as there are too many files and it doesnt allow Folders to be added.
Has anyone else had this issue?
It's frustrating as when I make changes to MainActivity.java it gets saved and committed/pushed okay but the VCS in Android just doesn't see the other files I have changed such as the content_main.xml which I changed to see if it would then be added to GH.
I cannot seee how to add files within Android Studio to GH via VCS. Does anyone have any pointers where I may start? Thanks!
NB I have had a look through existing questions but none address my issue as far as I can tell.
Usually when you start a new project, Go on VCS -> Enable Version Controle Integration.
Then you should have the Version Control accessible on the Bottom Left of the IDE.
In the tab Local Changes, you will see Default and Unversioned Files.
Just take files from Unversioned Files to Default to start to track them.
To my shame once I checked Xiaomis suggestion I could see that my git was pointing to a directory lower than my /app directory. I tried to change in in my GitHub shell but was unable to do this as GitHub Desktop shell didn't recognise the new directory.
To fix my muddle I deleted my original repo and delted the .gitignore file and other git files from my Android project folder. I then opened Android Studio and went through the process of creating a new repo from there, circumventing GitHub entirely. This worked and enabled me to select my /app directory as the Git root.
Thanks go to Xiaomi who's suggestion made me notice that git was looking at the wrong root. Live and learn!
I've tried, with zero success so far, to both create a new project and add GoogleCast to it and to get the given examples to work on Android Studio (currently using 0.3.2, but will upgrade if needed) on MacOSX.
Migrating to Eclipse, however, is not a valid option at this time.
I always seem to end up stuck with some reference issue, either giving me the error "No resource found that matches the given name '#style/Theme.AppCompat'." or multiple compile-time errors related to having no idea where android.support.v7 is located at.
Tried many different solutions, such as removing the #style part that someone mentioned to work or setting the v7 path as relative.
Though I wasn't able to follow through with this last one, no idea how to actively do that in AS and not enough reputation to comment there.
Then I came up to this solution Anyone get the chromecast android examples working in android studio?, which seems like a good attempt, except I can't seem to find the mentioned GoogleCastSdkAndroid.jar anywhere, so I'm stuck.
Couldn't find a truly comprehensive tutorial anywhere either, since they all seem to have no issues whatsoever adding v7 to the project.
Thanks in advance for anyone who can donate some of their time to solving this issue.
EDIT:
After upgrading to 0.4.6 (is 0.5.1 stable already? Considered how fast it came after 0.5.0...doesn't sound too good); I did what Ali Naddaf suggested, but couple extra questions popped up:
I could build the CastVideos project and import it into Studio with no problem; however, the CastVideos project structure is radically different from a new project's structure (referred to as OtherApp from now on).
The main issue that pops up when I try to mimic CastVideos on OtherApp is that it doesn't find the CastCompanionLibrary project on the OtherApp only, which I can't seem to be able to figure out where exactly should be located at (I thought the 'core' folder was the one with AndroidManifest?).
Also, how do you import modules now? The Project Structure only allows the creation of new modules.
My suggestions:
update your Android Studio
open SDK manager and make sure you have the "Android Support Repository" installed
create an empty directory on your system (referred to it as <DIR> below)
change directory to <DIR> and clone CastCompanionLibrary-android to CastConpanionLibrary
$ cd <DIR>
$ git clone https://github.com/googlecast/CastCompanionLibrary-android.git CastCompanionLibrary
$ git clone https://github.com/googlecast/CastVideos-android.git CastVideos
first make sure all is fine by building from command line:
$ cd CastVideos
$ ./gradlew build
it should do a successful build at this point.
if all is fine, open your Android Studio and select "Import Project" and point to build.gradle in the CastVideos project.
Now for any other project, you can look at the build.gradle in CastCompanionLibrary or CastVideos to see how you can set up your dependencies on the support libraries; if you don't have dependency on the CastCompnionLibrary, then it is even easier.
You very much need to upgrade Android Studio. 0.3.2 is quite old and a multitude of bugs have been fixed since then that are almost certainly affecting you.
Other than that, make sure you have the Android Support Repository installed in your SDK Manager. Between those two it should solve your support.v7 errors and #style/Theme.AppCompat issues.
This question is very old but to make it work I had to clone both Git repositories (CastCompanionLibrary & CastVideos-android). Import CCL into Android Studio as Non Android Studio Project, change the version of build tools to current 21.1.10, build the project and close it. Android Studio asked me to reopen the project. Hit yes. Do exactly the same with CastVideos-android and finally I could launch it into my smartphone.
Was really painful, took me 2 hours make sense of the error, because I was trying to open into Android Studio like Android Studio projects (they were) but there was a problem with the .idea file.
Tried this and everything worked.