Skip to content

Android Error – Lost References

Getting errors across your whole Android project and "The type java.lang.String cannot be resolved"? Here's a quick fix using Organize Imports in Eclipse.

Ramón Invarato

If almost your whole project is showing errors, and hovering the mouse over “package” shows the following message:

The type java.lang.String cannot be resolved. It is indirectrly referenced from required .class files

Eclipse screenshot showing the error "The type java.lang.String cannot be resolved" with the quick fix Configure build path

It’s easy: just remove all the “imports” in this class, save, and press “control+shift+O”, which organizes the imports automatically (right-clicking the project and choosing "Source / Organize Imports" also works). The rest of the classes in the package will repair themselves.

Screenshot of the Eclipse context menu with Source > Organize Imports highlighted to fix the missing references

“Android Error – Lost References” by Ramón Invarato at jarroba.com, licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0. Registered at Safe Creative.

Ramón Invarato

I design and build data platforms and intelligent systems, and I enjoy sharing that experience here.

You may also like

Comments

Leave a comment


This site uses Akismet to reduce spam. Learn how your comment data is processed.