I was trying to compile some code from AOSP (Android Open Source Project), and I ran into this error:
The import javax.annotation cannot be resolved
Caused by this code:
The solution was actually really easy:
- Go here:
- In the Version column click on the latest version number
- Click Download ( JAR )
- Copy the downloaded JAR file to the libs folder in your Android project (create the libs folder if it doesn't already exist).