Home > Java > javaTutorial > When using Android Studio, the source code reports red warnings everywhere, but it is correct when running.

When using Android Studio, the source code reports red warnings everywhere, but it is correct when running.

高洛峰
Release: 2016-11-21 10:58:12
Original
2020 people have browsed it

[Abstract: When developing on AS, I encountered this problem. I opened all the Java source files and the right side was all marked in red. I couldn’t find the class and couldn’t reach the method. Because I couldn’t click to jump, I was tangled during development. After a long time, I tried clean, rebuild and other methods but nothing worked. Also]

When I was developing on AS, I encountered this problem. When I opened all the java source files, the right path was marked in red and the class could not be found. , I couldn't find the method because I couldn't click to jump. I struggled for a long time during development. I tried various methods such as clean and rebuild, but none of them worked. I also went online to find tips from experts, but it might not work for me. Another colleague only asked for another AS installation, which was unnecessary and too troublesome. After researching and referring to various methods on the Internet, I am attaching a little trick that I have personally experienced and solved, so as not to panic when encountering such problems and find the wrong direction to solve the problem. (ps: This method was solved with reference to a problem on the Internet, but the original URL cannot be found, so I wrote it here for your reference only)

Small skills article:

1. Click File-> Invalidate Caches / Restart...

When using Android Studio, the source code reports red warnings everywhere, but it is correct when running.

2. Restart Gradle and clear the cache

When using Android Studio, the source code reports red warnings everywhere, but it is correct when running.

3. After AS restarts, java is no longer popular "everywhere"

Related recommendations

C# Reference public names in other namespaces Warning when using variables: Since "***" refers to a field of the marshaled class, accessing the above member may cause a runtime exception

In ActionScript 3.0, whether compiled in strict mode or warning mode, it will Perform runtime type checking

A warning and runtime error when referencing Enterprise Library 5.0 and its solution

Designer warning generated by loading UI files during QT runtime

Warning: Since xxx is a field that references the marshaling class, access the above Members may cause runtime exceptions

rmi activation warning that appears in Eclipse at runtime

27. Obtain runtime information (including runtime services, running tasks, and running process information)

Runtime generation instances + runtime Call methods+change fields content during runtime

How can I make the program run before XP starts the graphical interface? Like the Chkdsk command that runs automatically at startup or the timing of the convert (when converting C drive to NTFS format) command?


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template