Reset Build Order of a VS2012 Solution - visual-studio-2012

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.

Related

Validating Subversion Android Studio Project Build: New Project from SVN

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.

Android Studio has lost Run Configurations

Android Studio lost all the run-configurations of a project and it is not the first time this happened. This always occurs (as far as I can tell), when switching projects and/or having opened an Android project in IntelliJ IDE.
In an attempt to restore them, I've reverted several missing .xml files from the .idea directory, including runConfigurations.xml, which did not yield the desired result. the documentation does not really help either.
Q: Where are these run configurations being stored, (in order to keep a backup of them)?
As described in Run/Debug Configurations Dialog documentation when: Share check-box is enabled Run/Debug Configuration files are stored under .idea/runConfigurations/ directory.

Android Studio: Change inspection profile for one specific module in project

I have several modules in Android Studio project, and I would like to change inspections settings for one of these modules. More precise, I want to turn off all Android-related inspections in one module, but leave all general Java inspections in place.
I need this because I have a not Android-specific Java library module, and that module uses java.util.Properties, and it's load method was implemented in Android API level 9. Since that library is not Andoid stuff, I have not specified Android API level at all, and Studio warns me about that.
It offers adding Android annotation to ignore that inspection, but adding Android dependency to turn off Android warning seems bad.
I can edit the settings to shitch that warning off, but I don't want to turn API level warnings in the whole project.
As I found, in settings you can specify inspection setting either globally or for whole project, not for specific module.
Is there a way to change inspections settings for one module, or do some hack around?
I am using Android Studio 1.3.2.
The Studio should automatically understand that the Java module has nothing with Android, and stopped Android inspections (but they were not disabled, though): I went fix something in the code, rebuilt it several times, and when I returned to warning line, it was clean.
So, I don't actually know what's going on,
but I got some recomendations, that should help:
Sync your Gradle project, it will try to rebuild the project. Some dependencies and settings will only resolve after Gradle will do something internal.
If Gradle will fail, there might be errors in code that ruins interspections. Try to solve them.
If your project history is stored in VCS, try checkout the latest clear version and sync project again.
Check changes in .iml files manually. For some reason, Studio sometimes does weirds edits there, and if I rollback some of them, Studio works better.
Actually you can disable particular inspections being made by Android Studio. However this needs to be on all projects you have in Android Studio, and cannot be done in all modules you are currently developing.
To disable android inspections on your projects follow these steps:
Click on the File menu and Select Settings
Expand the Editor root node select Inspections
There you will have all the inspections which Android Studio checks when building a project (image below). You can expand the Android node and check what you wish to remove from your inspections.
Hope this helps :)

Android Studio is installing old apk on device

I am developing an Android app using Android Studio (0.89 Build #AI-135.1404660, Built on Sept 3,2014) using both emulator and Nexus 4 device.
I had the same issue with a version prior to that.
The problem is that after I changed my code and resource files, I still get the old apk installed on the device or emulator.
What do I need to do to get it to run current code? Is it a building config?
Is it a known issue with Android Studio?
Or with a Nexus 4 device?
This is the second time it has happened, and I resolved it(then) after trying one of the steps below. They have not worked for me again.
Here is what I've tried
Build > Clean Project > Restart Android Studio > Run
Build > Rebuild Project > Run
Step 1 plus Uninstalling of apk on device
Step 2 plus Unistalling of apk on device
Adding erroneous resource entry then running.
I have read the following:
Android apk install: How to clear files from old version?
adb - How to reinstall an app, without retaining the data?
Device still has the old apk
Android build doesn't update code base or resources for target .apk on device
None has worked so far.
I had the same problem. After trying numerous methods that didn't work, I realized that I had accidentally changed an option in my "Run Configuration". Here's exactly what I did to fix the issue.
Run --> Edit Configurations
With your configuration selected on the left panel (mine says "app"), in the General tab on the right panel, there is a section called "Before launch". This section should have an option added called "Gradle-aware Make", but I had accidentally removed it.
I re-added it by pressing the "+", then clicking OK in the popup (leave the input box in the popup blank).
Click apply.
This fixed the problem immediately. Hope this helps someone!
Run / Debug Configurations / Miscellaneous TAB
[] Uncheck: Skip installation if APK has not changed
Android Studio doesn't always detect small changes in code.
The behaviour is erratic. I solved it by reviewing my code.It turned out that there was a resource file that was invalid. Try reverting back to the last working version of your code before the current changes... Probably a known issue that will be/was resolved out of Beta
Google thinks it is a feature, not a bug
https://code.google.com/p/android/issues/detail?id=156263
Their proposed solution is to copy the apk(s) instead of manipulating the filename, as in e.g.
Copying APK file in Android Gradle project
I've spent way too many hours to keep this to myself. The way I fixed it was that I noticed some hours later that I was using different layout version in res/ .... I have actually two versions of layout (layout-v26) and (layout). All this time I was modifying the other one and uploading different one. Maybe its just a newbie mistake but I hope somebody will find it useful.
The reason why there are 2 version was because of " autofillHints="" -> quickfix -> create new version of layout "
image of my tree
I am using android studio for building flutter app, I was facing the same issue untill I did the following:
From Android Studio, go to Tools-Flutter-FlutterClean
It resolved my problem as of now.
Check Your Layout Files.
I ran into the same problem and I realized, it gives some problem if you have same layout in multiple orientations(portrait and landscape). If one is changed other remains unchanged and then it creates a conflict. So android studio installs the one with the previous layout
PS: This was happening in my case.
The problem occurred on my Android 11 devices. I guess ART ran old code dex2oated.
Solution:
Run / Debug Configurations - General - Always install with package manager (disable deploy optimization on Android 11 and later), and check the option.
I was also facing this issue and get solution by deleting build folder manually because some time ide cannot be able to delete this. So go to the app folder and find build folder delete this and after clean and build project and run again.
projectname->app->build
You should select "Deploy default APK" option in Run/Debug Configurations. After that Android Studio will upload and install new apk to your emulator/device when you run application.
In android studio. at right side. see gradle option. click it. and then press circular arrows button shown in red square.
Same problem, none of the solutions mentioned here had any effect. I had to disable the "Allow parallel run" in "Menu > Run > Edit configurations...".
You can read more about this option here: How to run the same project multiple times in IntelliJ IDEA?
The solution to this issue is actually very simple.
Android studio is actually not detecting some small changes that you have made to the application. That is why it is installing the previous builds.
The solution is easy -> Remove the previous builds.
In the right side, go to gradle tab.
Expand Tasks. Find "clean" or "cleanCache" task or any task that starts with "clean". Double click to run that task.
Expand "app". and do the same.
Then File> Invalidate cache and restart.
Enjoy!! Your problem is solved...
My devices also ran old states - dont know from where in my git it has taken these.
I created a new configuration (default is "app") and it worked.

Publishing projects without VS Publish

Our team has been having quite a lot of trouble with Visual Studio's publish feature. We use TFS and are all running VS 2012 ultimate. It works fine when only one person is involved in a project, but when we get many people inside one project, the publish profiles get off and Visual Studio reports a successful publish even when all files haven't been copied up. I've read all the SO questions about why this happens and I understand that TFS adds the publish profiles to the source control automatically. If we create a new publish profile and republish, everything works. But this is not sustainable. I can't prevent VS from automatically adding the publish profiles to TFS (if we could, I think this would solve the problem) so I'm now looking for better ways to publish an application to a web server. Is there a better tool out there to publish web applications or do I need to write my own VS extension?
Per this question (https://stackoverflow.com/a/12393154)
The temporary answer seems to be to change your settings from release to debug, save, then switch it back. This causes the pubxml.user file to be rebuilt, which is actually the problem.

Resources