2

I'm an Android Studio noob and I'm confused about how it reports errors. I have a fairly large Android project - about 25 java source files - mostly Activities - and a similar number of XML files.

I do a Build> Clean Project and a Build> Rebuild Project, and the Gradle Console reports BUILD SUCCESSFUL. In the Messages tab it says:

BUILD SUCCESSFUL

Total Time 4.368 seconds

0 errors

0 warnings

But if I actually open up an XML file, e.g., the Android manifest.xml file, I see errors marked in red, such as

Cannot resolve symbol 'PlyListActivity'

and

Cannot resolve symbol 'ActivityMsgClass'

... those seem like errors to me. Yet the Android manifest.xml file is not marked or highlighted in any way in the UI - if I hadn't opened it in the editor I wouldn't have seen those errors. So short of opening up each of the 25 XML files in my project, how can I find out about such errors when I do a build?

Edit: Just to be clear - my question is not about what causes the errors listed in the manifest. My question is why does the build show 0 errors and 0 warnings, and is there any way in Android Studio to be aware of these errors/warnings short of having to open up each and every file (25 in my case) in the editor to look for them?

asked Jul 12, 2016 at 19:38
4
  • 1
    Where are PlyListActivity and ActivityMsgClass defined? Are they the classes of yours? Commented Jul 12, 2016 at 19:40
  • this show both the class are not defined in your project as activity Commented Jul 12, 2016 at 19:40
  • Yes they're mine. But that's not my question - I'm not asking for help resolving those errors. My Question is why the build is reporting 0 errors and 0 warnings, and how I can see a summary of errors like this without having to open each file individually to see if there are any problems. Normal IDE's flag files with errors in them. Commented Jul 12, 2016 at 20:11
  • I updated my answer, please see it. Commented Jul 14, 2016 at 5:23

3 Answers 3

1

This is a very annoying bug, and it's been around forever. Unfortunanetly, there is no way you can fix it, this doesn't only happen to the Manifest but to the resources XML files too. However, your app will crash if there is a real error, not a warning.


However, there could be a way if you mess around Android Studio, I couldn't find this, but maybe you could:

Go to Android Studio. Go to File>Settings, alternatively press CTRL+ALT+S

Go to Editor>Inspections,now here, you can change all the errors in Android Studio to a warning, or nothing and vise-versa. This could solve your problem if you find your error in this window and disable it (Make sure it is Manifest Only). Otherwise, I hate to say the answer even for myself, there is no solution.


UPDATE: If you go to Analyze>Inspect Code you can see all your errors and warnings in your project.

answered Jul 13, 2016 at 19:31
Sign up to request clarification or add additional context in comments.

Comments

0

This is not an error. This show both the class are not defined in your project as activity, but you have still defined in manifest as activity.

answered Jul 12, 2016 at 19:42

3 Comments

I don't understand - how is "Cannot resolve symbol..." not an error (or at least a warning)?
You can say it a warning
I don't care if you call it a warning, an error, or an issue. Normal IDEs (e.g., Visual Studio, Eclipse) produce a summary at build time of issues like this that need the developer's attention. I assume there's some way to see this in Android Studio, too, but I don't know what. That's my question.
0

If you run the 'lint' gradle task, it should generate an webpage that details all the warning/error/issues it detects during build time.

Ran lint on variant debug: 11 issues found
Ran lint on variant release: 11 issues found
Wrote HTML report to file:///C:/Android/JsoupExample/app/build/outputs/lint-results-debug.html
Wrote XML report to file:///C:/Android/JsoupExample/app/build/outputs/lint-results-debug.xml

lint

answered Jul 13, 2016 at 19:00

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.