javaandroidimporttreemap

Cannot resolve symbol TreeMap on import


The code was compiled in android studio (API 23). When I tried to run this code again in a week, the class file became corrupted, when I used the old version and decompiled of this class, it turned out that the TreeMap in java does not exist although in documentation it was added in API 1.

Tried to Invalidate Caches and Restart. Is there an opportunity to use TreeMap or something else with the same functionality?

Imports

UPDATE: The program has compiled despite this.


Solution

  • If the program compiles but you see errors in Android Studio it's a problem with project definition in Android Studio. This is often solved by following steps:

    1. Check that project has the right Android SDK configured
    2. If point 1 doesn't help, restart Android Studio
    3. If point 2 doesn't help, re-importing project
    4. if point 3 doesn't help, use File > Invalidate Caches / Restart option which will force a big re-index operation.