I'm just getting started with eclipse and android development. One thing which is driving me crazy in eclipse is the problems panel with error/warning messages. It displays errors and warning from every project that I have added to eclipse. I only want to see feedback from the project (or ideally individual file) that I am currently working on).
For example, I have two android projects added to my eclipse workspace: HelloAndroid (a sample app) and SMSTest (an SMS2Toast example). Even with no files open, I see warning messages from both projects! Why is this!?! I shouldn't see any output unless I actually have a file open...or is this just the way eclipse works? Should I be using a different workspace for each project?
Thanks for any help anyone can give me.
This will get mostly what you want:
Open the "Problems" view (Shift-Alt-X-Q)
In the right hand corner there is a drop down arrow
Select "Configure contents"
Then pay attention to the "Scope" options
I also highly recommend in that same menu "Group by" -> Java problem type.
Right-click the unwanted projects and click "Close Project" you shouldn't get notifications from them at that point.
Other than that I'd recommend fixing most errors before moving away from them. If you're not prepared to complete various functions at any given time just put a stub in them that satisfies conditions with a quick //TODO: statement telling you to fix it later.
If you're talking about working on a page in general and the errors are combersome and annoying then try double-clicking on the tab for the file you're coding (above the code window) and it should become "fullscreen" hiding the other portions of eclipse.
As far as I know, this is the way eclipse works. It makes sense in that if you make a change in one file, and it causes a compilation error in another file that you don't have open you would still want to know about it.
You CAN configure which situations are considered WARN, and which are IGNORE in Preferences > Java > Compiler > Errors/Warnings.
Also, if you only want warnings from one project you can CLOSE the other project, which would keep you from having to reconfigure a new workspace for each.
Related
My goal is to be able to use the keyboard to quickly go through all the compilation errors in a project. It is like using F2 or shift-F2 to go through errors in a single file, except not only the single file, but every file in the project.
I could even accept having to open all files with errors (or even all the files) and using shift-F2 and ctrl-F4.
The build output panel in Android Studio seems to only allow clicking via a right click menu to go to the next problem which is incredibly slow.
A problem file can be fixed, and then a build triggered with ctrl-F9 to seek to the next file, but that is also incredibly slow.
I have done some googling in an attempt to find a solution, but am only finding irrelevant results.
To me, it seems to be a simple to implement UI feature with a great quality of life improvement that should exist. Does it exist or does an issue need to be created?
I did find a way to use the keyboard to go through errors in the build panel.
CTRL-Tab-B will move focus to the build panel. Then Tab will move focus to the build output tab of the build panel. Then you can arrow over to the next problem file and hit enter to put focus in the source file at the error.
Quite a lot of key presses to go to the next error in a project.
Update: An even better way is to press alt-6!
As you might know, Remove Unused Resourceshas added recently to Android Studio, Android Studio 2.0 Preview 5.
I run this function by right click on the name of project then Refactor/Remove Unused Resources. It shows a dialog and nothing happens when I click Refactor or Preview buttons. I believe there must be a lot of problems since this is a very big project but I don't see result. Are you able to see any result?
Okay, I just found what is the problem.
The problem was, as I mentioned I was right clicking on project name and did refactoring from there. So this way doesn't work (Android Studio guys must disable this functionality to not staffing people around)
So, By running Analyze/inspect code I could see a list of unused resources. I doubled clicked on an String item then String.xml opened and by doing refactoring/remove unused resources... all resources removed :+1
So it was the trick. I could see all changed files on git. Hope it helps you guys.
I can not see any errors or warnings in my Eclipse(4.4.2) unless I specifically select the project or file in Package Explorer and then go to the Problem view.
So far I tried different options in "configure contents" and "show" dialogs in the Problems view menu without success. The only time I see errors in the Problems view is if I set the options "show all" or "all errors" and then it shows every issue with every project I have, don't want/need that.
I also tried (following suggestions from other posts) closing/reopening project, Build Automatically and fix project properties... no luck.
I remember it used to be that if you had issues in a file you were currently editing you could jump straight to the Problems view and it would show you the issues for the project where that file lives, in other words the current project being edited. This is the result I want.
Android SDK manager is up to date so I am out of ideas. Appreciate any help.
Open the 'Configure Contents' menu and select the 'All Errors' (click the line don't use click the check box). You should then be able to configure the Scope of the errors on the right hand side of the dialog (such as any element in same project)
I'm a .NET developer but I like JAVA so in my free time I play around with that. I don't normally use Eclipse but I installed the ADT eclipse plugin and Andriod SDK and I started learning and I made a new project with a TableLayout and it kinda looks good, and it runs ok on the emulator.
However... there a few things that drive me absolutely catatonic and perhaps I am doing something wrong so please help me out.
Firstly, if I change the main.xml file in whatever way, even by adding what is supposedly a correct parameter, it will start freaking out and will generate an error that just says "error" without specifying what that is, it will then generate a main.out.xml and then report an error that the main.out.xml is empty. It later won't let me delete that and will start generating a main.out.out.xml and so forth, even after I correct that original xml that caused the error.
The only way to get things going is to delete the bin folder, restart Eclipse, delete all the out xml files and then sometimes it will run the application or some other times it will start generating those 'out' files again and the loop goes on.
That way it takes hours to run a simple app even one without errors that used to run before.
Surely that was NOT how they intended it to work, is it??
Also.. there is no "Rebuild" button that will flush all files out automatically, or is it hidden somewhere? I am tired of manually deleting those automatically generated files and the build folder and all those out.xml files.
Also, while I'm at it, I also want to point out that the designer view sometimes disappears and there is nothing on earth that will bring it back, the only way is to create a new project and copy the main.xml to it and then it shows up again. Another bug?
I have the latest eclipse version:
Version: Indigo Service Release 2
Build id: 20120216-1857
If you have any clues how to get this to work, I will appreciate it!
Many thanks in advance
When you click the Run button with an XML file selected, Eclipse is running an XSL Transformation on that XML and producing the .out.xml file as the result. This is a feature of the Eclipse Web Tools feature, which you'll have if you installed the Eclipse for Java EE Developers package (it may be included in other packages, too).
As others have said above in the comments, to run your Android app, select the Project, right-click, and choose Run As > Android App. Once you've done that once, it will create a Launch Configuration that you can launch from the Run or Debug toolbar buttons (pressing the small down-arrow on the Run or Debug buttons brings up a list of Launch Configurations that you can select from, as well as an option to manage them).
There is a Preference that will make Eclipse always launch the last thing you ran or debugged, instead of trying to be smart about what is currently selected. Open the Preferences and navigate to Run/Debug > Launching; there you'll find the option under Launch Operation at the bottom of the window.
I've recently starting developing with the android sdk. Currently, I am trying to add code to use a menu, however, when I try to add a menu.xml under res/menu, Eclipse hangs and freezes every time. When I reopen the Eclipse, menu.xml is there, but every time I try to open it, Eclipse hangs and freezes again.
I am running on OS X Snow Leopard, Eclipse 3.6.2 and the latest android sdk and adt plugin.
Any help, insight, thoughts?? I am thoroughly stuck.
Thanks.
Dustin
Thanks for the input guys. What ended up working for me was instead of trying to manually create a new menu.xml file, I find the add android .xml wizard and using it instead allowed me to add whatever I needed with out any hang ups.
Same problem happens for me even under the latest version of Eclipse (Helios). If I wait long enough, Eclipse reports a stack overflow exception and then this shows up in the Output window:
W/ResourceType( 5124): Bad XML block: header size 0 or total size 9949440 is larger than data size 0
menu.xml:1: error: Error parsing XML: no element found
This indicates that the XML parser isn't handling empty documents and the Android menu editor is barfing on the newly created file while trying to open it. I'm sure there is some "standard" way of creating a new menu that doesn't break the IDE but I have no idea what that method is. I'm too used to editing my files by hand but this crash/hang bug is a serious nuisance.
Dustin,
I think what has happened is, your settings have become corrupt. I highly recommend resetting all your settings. Keep in mind, you will have to re-import all your projects so this can be quite a pain, but I really think this will fix your problem.
To start, find your workspace folder and rename it to something like "workspace-bad"
Then, create an empty workspace folder to replace the one you just renamed.
Lastly, open eclipse and it will act just like a brand-new installation.
You will need to re-import your projects, which can be done by going to eclipse, hitting File>Import...
Then select under General
"Existing Projects into Workspace"
then hit "Next" and then hit "Browse" to find the root directory
also make sure "Copy project into workspace" is checked
I also recommend doing your "problem project" first, that way you don't waste your time doing the rest and then find out you have to re-create it.
I'm hoping that fixes it for you, good luck! :-)
-Jared
I ran into the same issue with the same setup. Right clicking menu.xml, selecting 'Open With', and selecting Xml Editor seemed to be a viable workaround for me.