Android Studio 3.1.2 0 - no longer see errors in all files (red underlined) - android-studio

I feel like I'm going crazy, but since updating to the new version of Android Studio, I can no longer tell which files have errors in them.
Previously, if I made a change in one class, like to a method signature, then all other classes that were calling that method would suddenly be highlighted in red (at that section along the top that shows the path). Now it shows nothing as though my code is good, except when I go to compile, I now get a load of errors in the build tab at the bottom, in a really unhelpful way to navigate through.
Is this something I can switch back to through a setting somewhere? I'm really not sure what to search for, but I've been through almost all of them.
UPDATE :
Following another SO post, I turned on and off PowerSave mode, at the bottom of File menu (in Android Studio). This, temporarily at least, seems to have solved things.

This may be what you are looking for?
Either that or it may be in preferences.

Related

Android studio keeps underlining all classes red while saying that R doesn't exist

I know this has been asked many times, but usually the advice is something along the lines of "decrease Android gradle plugins version" or something like that. Firstly, that doesn't seem to work for me, secondly, decreasing the version in order to solve this kind of problem doesn't seem like a good practice and I'd like to avoid it (especially since Android Studio warns me I should increase the version back again when I try to decrease it).
So now what exactly is happening + some details that might help:
Every class is underlined with red color in the project explorer and there are loads of "java package R does not exist" messages in the Problems view
When I open any class, suddenly its red underline disappears and there are actually no errors in this class
It happens if and only if AS does an automatic build (I can see "21:03 Auto build completed with errors" in the Event log). When I build manually, there are no errors in the Problems view, and no class is underlined (that is, until AS does auto build again, which happens all the time)
In any way, this doesn't prevent building of the application/APK/AAB, installing it on the phone/virtual, and running it
This has been happening ever since I updated Android Studio to v4.1 (I now use Android gradle plugin v4.1.0)
(Of course, I also tried all the obvious stuff - deleting every temporary/generated file, invalidating cache, restarting, cleaning, etc. etc. Everything I could think of.)
I had a problem like this before, it had nothing to do with the gradle ijust add "import com.package.appname.R;" into myclass and is worked

How do I get typo warnings in locale-specific strings.xml according to my custom dictionaries in Android Studio?

Same question here, but I'll try to explain it better.
I want Android Studio to give me typo warnings according to my custom dictionaries. Typo inspections are enabled properly. I have already set up my project dictionary and portuguese.dic in settings, and spell checking works fine in code.
It also works in values/strings.xml (the default locale) but it doesn't work in locale-specific xml resources, like values-pt/strings.xml. It gives me warnings for common misspellings for pt language (which it detects automatically), but I want the typo warnings that assume every word is wrong except for the ones present in my dictionaries.
I have tried changing the tools:locale attribute to many values, but the problem remains: this affects only the "common misspellings", not typo spell-checking, which is disabled for the file no matter what I do.
I even tried disabling the Inspection for "common misspellings" (Android/Lint/Correctness/Messages/Spelling error) but it didn't work either.
Is this a bug in IDEA/Android Studio? It seems to be this way by design, but maybe there is a setting or something I'm missing.
Is there a way to enable this check, or some workaround to make it work?
Ideally this should just work in the editor, but if not possible, it would be fine to have at least a gradle script or something that I can run once to make sure everything is OK.

visual layout editor does not allow drag&drop

I'am a newby in android studio and learning a lot, but now have a problem where i cannot seem to find the answer to.
In android studio you can visualy drag&drop your screen.
I have seen it can do al lot (although you sometimes need the xml) but for me it is not working at all.
I mean i cannot drag&drop any widgets on the screen at all.
Tried changing the theme: no help (really tried a lot of them)
Tried a complete new project: same story
Tried other APK verion: same story
Tried Invalidatd caches / restart: no help
Even with a new project (EmptyActivity) it add's a android.support.v4.widget.NestedScrollView and then gives error's on that
(Failed to find style 'coordinatorLayoutStyle' in current theme).
It also gives an error on layout_height/layout_with not being there. But they are there for each widget.
Please do not missunderstand: when i execute the project i runs just fine (both on phone and emulator) but the visual builder for the screen.....:-(
Does somebody knows how to solve this.
If more info is needed please ask.
Any help is more than welcome.
There are several things that could be causing this:
Your caches could be messed up. Try going to
File > Invalidate Caches / Restart ... (I know that you already tried this, but posting for future views.)
Also, make sure that you don't have Drag-n-Drop with ALT pressed only checked in your Settings (Appearance & Behavior - Appearance).
Finally, in a default project created in Android Studio, there are two XML files created for each layout. For example, content_main.xml is embedded within activity_main.xml. Make sure that you are using content_main.xml for your design work.
In the end i fixed it by changing the SDK version in de gradle file.
still do not understand why it was wrong as studio genereded it that way but now it works so.... for me: case closed.

What is the general approach to fixing Go To functionality in Resharper

I often see that some of the ReSharper functionality just doesn't work until you restart VS and reopen the project. But this situation I have now is consistent across restarts. So I am using a Go To Everything fuctionality often. It is enabled in ReSharper settings.
But since yesterday Go To Everything (Ctrl + N for me) can't find most of the files in the project (though it can find some).
Here is a screenshot of the problem:
I have that file open in editor just to prove that it's there. I show it found in an open solution in file tree. But ReSharper doesn't seem to be able to find it.
What to I do to troubleshoot. Thanks you in advance.
The best thing to do here is to raise an issue with JetBrains. Either log a bug with the issue tracker, or email resharper-support#jetbrains.com. Include details about what version of ReSharper you're using, what type of projects you're using, version of Visual Studio, etc.
However, from that screenshot, it looks like ReSharper isn't configured to analyse that file - there's no "green tick" in the scrollbar. Is ReSharper disabled? Is that file excluded from analysis? (Mind you, even when it's excluded, it should still show up in go to results. Something odd is happening here, support should be able to help better than StackOverflow)

Have you used JustCode?

Has anyone used JustCode from Telerik lately? This question has been asked about two years ago, but I'm sure the issues must have been resolved by now. Especially referring to running it side by side with ReSharper.
I have been using Resharper for a while now. I decided to try JustCode to see how it behave.
After a week of using JustCode, I am uninstalling it and returning to Resharper.
What I like about JustCode:
A single window indicating all warnings/errors in entire solution.
Performance seemed to be a bit better than Resharper.
Refactoring is easier to get to.
Projects can be excluded, or type of file
Language can be excluded (such as XAML)
What I did not like about JustCode:
Sometimes the underline used to open the option for fixing or refactoring is frustratingly hard to click since VS also puts an underline at the same spot (and it is the context menu of the latter that pops up).
Cannot change an hint to be a warning instead.
Saw some minor bugs
JustCode was giving hundreds of false positive warnings in the XAML code (luckily I could turn the inspection of XAML off)
What I was missing from Resharper:
Warnings about method parameter missing/mismatch from the documentation
Hints to transform an expression into a Linq expression.
When writing an opening bracket, resharper automatically adds the closing one and puts you on an empty line in between the two.
When completing a method, Resharper adds the first parentheses. It also adds the last one if that method is parameterless.
I am sure there is a bunch of other stuff that I can't remember now
You can install both Resharper and JustCode alongside. I first suspended Resharper before installing JustCode and used JustCode fine. When I resumed Resharper and restarted VS, both were running together without error.
Together, Resharper was finding more than JustCode.
For example, JustCode did not give a warning for the following: "Value assigned is not used in any execution path."
It even missed an error: "Cannot convert type 'int' to 'bool'." The expression was:
if ((bool)CanDoIt) // Here CanDoIt is a property of type int.
{
...
}
All in all, the tool is not bad. I recommend it over not having any. But if you have the choice between Resharper and JustCode, go with Resharper... for the moment; JustCode is still young.
You can change the size of JustCode's smart tag or turn off Visual Studio's smart tag in JustCode's options menu. I prefer to access VS's smart tag by using ctrl+., so it hasn't been an issue for me.

Resources