Validating Subversion Android Studio Project Build: New Project from SVN - android-studio

Given an existing Android Studio (4.0.1) project that builds and deploys properly and that has an associated SVN repository, I would like to create a separate Android Studio project and get that to also build properly. The purpose is to 1) Prove that the SVN repository is complete (has everything needed to get a build working), 2) Document the steps required to get this Android Studio project out of SVN and building.
Selecting Get from Version Control from Android Studio's welcome screen, I can specify the SVN repository and checkout:
Take the default/latest format for SVN:
And indicate I'd like to make a project out of the contents of the SVN repository:
Then I'm presented with an option that I'm unsure how to answer:
I have tried them all, none successfully. Rather than go into the details of each here, I would like to learn about which option makes sense in which situation.
The original project was created 5 or more years ago with Android Studio's 'start a new project' wizard. I've use Android Studio's default build stuff all along, and upgraded Android Studio and the various plug-ins when nagged sufficiently. I'm not sure what the important build artifacts are (or artifacts critical to a clean import are), and if those artifacts are indeed in the SVN repository and up to date. I can copy the project in the file system and rename things to get it to build, but creating another instance is not the question; the source must be exclusively the SVN repository.
I'm eager to make this question complete, so please do me the favor of specific criticism in the comments so I may improve the question or remove it, as needed.
The optimal person to answer this question would know much more about how Android Studio builds work than I do. I have strictly "cookbook" level knowledge. So without significant study, I am unable to validate intricacies of the process without more knowledgeable people to help.

The last Import Project dialog from this SO question only appears if the contents pulled from SVN are not a complete project.
In other words, if what gets pulled is a complete project, the project just opens, without having to go through any other questions and/or selections. Otherwise, other logic takes over and Android Studio tries to create a legit project for you from the bits it finds.
The solution is to make sure that the check-in from the original working project is complete, including gradle files. If Android Studio is set to view the "Android" artifact view, then everything in the list should display in the VCS "included in source control" and "checked-in" font color.

Related

How to Build Sample Android Location App from GitHub

I downloaded the Main branch of the Sample Android Location App from GitHub as a ZIP file.
https://github.com/android/location-samples
Once on my computer, I unzipped the file to a subdir.
Then in Android Studio (4.1.1), I imported the project by specifying the unzip'd dir.
It opens fine, but I am unsure how to build it.
In addition, Studio editor shows several errors such as "Cannot resolve symbol 'AppCompatActivity'".
Not sure how to proceed now to build, test and debug. I am sure it is something simple I am overlooking. I checked the ReadMe. This is the first time I have attempted to download and Build a project from GitHub Android Samples, so just need a couple pointers.
After unzipping the file, you can import it to AS
Choose the dirrectory with Android icon to open the project
Then it will download the dependencies, jars, SDKs, etc. After downloading, you can refer to the upper right side, where you can choose which App to build, then click the green arrow, gradle will take care of the rest.
If it didn't show the green arrow, the gradle sync might have failed, and you can sync the project by click this

Change the subversion commit location for a copied project in android studio

I have a project which i have copied from a different completed project,and refactored the package name. after the refactoring and sync was complete android studio asked me whether i wanted to add the newly created files to subversion. i remembered that my previous project was shared through subversion. so i went ahead and disabled the vcs integration for my current project to prevent any accidental modification to my previous project. but now whenever i enable vcs integration on my current project, i am not able to share it as a new project through subversion. i think android studio is holding onto the url of the previous project. so my question is how can i change this? i want to share my newly created project as a new one through subversion. how can it be done?
i remember when i used eclipse, i was used to deleting the CVS directories from my newly created projects which are copied from other ones, and it worked flawlessly. is there any way like this with android studio?
thank you.
I got my answer eventually. the trick was to delete the .svn directory hidden in the root folder of my project. deleting that directory gave the prefect result. and i was able to share my project as a new one through subversion.

Android Studio Artifacts

After developing in Eclipse for several years I have switched to Android Studio since two days. Although I have read as much as possible about it I still have one big problem: I can not find the place to add, change, configure or whatever about the so called artifacts.
I have tried several ways from creating a new project from scratch to importing a complete Eclipse projects.
Although the IntelliJ documentation is clear about it, I can not find it.
The project structure in all cases only shows three parts in the structure:
SDK location, Project and app. I have searched them all but no artifacts.
Who can help me?
The artifact description is in the IntelliJ IDEA manual that is reached by selecting menu item 'Help, Help Topics' in Android Studio.
However, according to JetBrains Support the Android Studio documentation topics need to be updated and the Artifacts page should not be available in Android Studio.
See also: https://intellij-support.jetbrains.com/requests/58563

Where the JDKName is coming from?

I am using several computers to work with my android project. Every time I am checking in my updates to GitHUB I see several files where updated even though I did not really update them, namely the *.iml files and .idea/misc.xml file. What changes is the value of the jdk-name attribute. While checkin ig from one computer it is '1.6 (2)', while from another it is just 'JDK'
My understanding is that something in the setup of JDK is different between my 2 computers. So what is different and how do I fix it?
The JDK names are maintained internally in Android Studio; this is different from IntelliJ where you edit them through the Project Structure dialog.
It's not intended that you check .iml files or anything in the .idea folder into source control in Android Studio. The Gradle build files are the source of truth for project structure.

Reset Build Order of a VS2012 Solution

I have a VS2012 solution with consists of more than 30 projects.
I ordered them manually for the build process by setting dependencies in the build order as desired.
Is there an easy way to revert those changes from within Visual Studio?
(without editing the settings for all those 30 projects again.)
Note: Reverting form source code management, which would be the most obvious option, is not the desired solution here.

Resources