No Android facet found, issues compiling with Android Studio 0.2 - android-studio

So, following the advice on this SO post (sorry, I would comment there expect I don't have enough reputation)
Gradle: FAILURE: Could not determine which tasks to execute
I removed the tags from my .iml files, which allows me to compile. But when I go to run the .apk on a device, I get the error
"Error running TestProject: No Android facet found for TestProject"
Can someone help please, just want to get back to writing Android apps!

Add an android facet to your module by following below steps.
1) Go To File Menu -> Project Structure, or press (Ctrl+Alt+Shift+S) shortcut to open "Project Structure".
2) Select "Facets" which is under the "Project Settings" tab. (First column)
3) Click on "+" button which is at the top of the Second Column to add new facets.
4) Select "Android" facet from that "Add "menu which will prompt another dialog box to select a module. (Select a module to which you want to apply this facet).
5) Select your module and that's it. :)
Hope this will solve your problem.

At the toolbar left of the run and debug button there is a drop down. Select your project main activiy.

In my case, it helped to just go to "Edit Configurations..." and delete the current configuration. Then I just created a new one with the default options.

Related

How to exclude some directories from "Analyze -> Inspect Code" in Android Studio?

One code directory is from a long working library, but the code inspector complains about many issues in it. How do I exclude it from analysis?
I've tried looking at the settings, and also tried right clicking on various things through the analysis.
I'd like the code inspection to work for most of my project, but not from parts of it that work and analysis is unneeded. In this case, it is a complex open source C language library where I do not want to touch the code.
Okay - I feel a bit dumb, but so others don't have to go through this, here are details. Also, it is very easy to screw this up - the Android Studio GUI will let you do stuff that looks good in the dialog, but doesn't work. It took me several tries to find the magic that works.
Here is the procedure:
From the main menu, select "Analyze" then "Inspect Code"
Click the button next to "Custom Scope"
Click the three dots button - to the right on the same line. A new dialog will pop up.
Click the plus ( + ) - upper left, to start a new Custom scope
Give it a name
Select "Local" or "Remote"
In the drop-down of the new dialog, select Project view
Of the four icons, click them until only the one for file display is emphasized
Find the top directory of what you want to analyze, and click "Include"
Find each directory you want to exclude, and click "Exclude" for each
Click OK - the custom scope dialog will close
Click OK - the analysis will run
In the future, that scope is available by name, but remember that it does not honor the implied scope if you right-click a directory in the hierarchy.

xcode 8 delete old objects

for a few minutes i had an second version of my core data:
this entry isn't available and i would like to delete it.
but i didn't find a way to do this? how can i delete this old unavailable object?
I suspect the reason your have the scenario is that you have 'Add a Model Version' in Editor and some how hit cmd+delete on the model in the master folder in Finder. You still have original version 'CoreData.xcdatamodel' in your master folder. Here is the how you can clean up the Project Navigation.
1) In Xcode Project Navigator, Right click *.xcdatamodeld and hit 'Delete'.
2) Still in Xcode, put mouse over either project name or group name ( first create a new group under your project. e.g 'model'), then right click and select 'Add Files to "ProjectName"...
3) A Finder window will open. Navigate to your *.xcdatamodeld, select and click 'Add'
4) Now you should get back *.xcdatamodeld file in Xcode Project Navigator clean without red V2 model.

Android Studio : How to reformat code of entire project?

I am looking for a way to reformat code of entire project, which is available for individual files via code -> reformat code.
Right click on app folder in android studio , from left panel . You will see the option for Reformat Code
Select your sources folder like "java" and use the command Ctrl + Alt + L
OR
Right click on source folder say for instance "java" and select "Reformat Code". A dialog "Reformat Code" would be shown. Select checkbox "Include subdirectories" and hit "Run".

Visual Studio Shortcut for building all T4 in solution

I just upgraded my VS2012 Proff to Ultimate and lost some settings. One I lost I can't find anywhere. It is a button I which builds all T4s in the solution. Anyone have an idéa?
I'm assuming it's somehow disappeared from the Build menu.
Right-click a toolbar or the menu bar and go to Customize.
Choose the Commands tab
Select Menu bar = "Build"
Press "Add Command"
Under Category "Build" you should see "Transform all T4 Templates"
Click ok to add it back to the build menu
[Optional] Move it up or down to where you want
Click close
The command should also be on the Build toolbar - you may need to do Add Or Remove Buttons or Customize to get it to come back. You can follow the same steps as above but instead choose Toolbar = "Build" in step 3.

Where is my "Recent Projects and Solutions" option?

I recently installed Visual Studio 2012, and I've been banging my head against my desk looking for missing options.
I use the Recent Projects and Solutions menu option (under the File menu) a lot in Visual Studio 2010, but don't have anything like that in Visual Studio 2012. However, my boss does, so I know there's something wrong with my install or an option I've missed.
I've casually looked through registry settings for anything like "Project" that exists in my 2010 settings but does not exist in my 2012 settings, and came up empty handed. Does anyone know how to fix this?
It looks like some part of the upgrade process just removed this menu option for me. Following nithins link to this question, I followed the instructions the author created to re-create the Recent Projects and Solutions menu item.
For posterity, those steps were (performed in Visual Studio 2012):
Under the Tools menu, click Customize...
Click the Commands tab.
Change the Menu bar selected option in the drop-down list to File.
Click Add New Menu.
Click Modify Selection, rename to Recent Projects and Solutions.
Under the Menu bar drop-down list, select File | Recent Projects and Solutions.
Click Add Command...
(The Add Command menu should appear here.)
Under Categories on the left-hand side, click File.
When the Commands list (on the right-hand side) refreshes, click Recent Project list, and click OK.
Click Close.
Happy project switching!
I had the exact same problem, but I had the sense that other menu items were missing as well.
What I did was go into Tools => Import & Export Settings, choose Reset all settings, and then select the same profile as when I installed Visual Studio. (General Development Settings.) That fixed the issue.

Resources