I am using the Libgdx game library and I started having a problem when I upgraded from Android Studio 1.5 to 2.1 and upgraded the APIs and build tools that Android Studio prompted me to.
My project was working correctly prior to upgrading everything. Now when I run my program, I get a "file not found" error with a Libgdx function that should access a file. I stepped into the function to the point at which it calls file().exists()
from java.io.File
. When I jump to the declaration of file().exists()
, Android Studio takes me the code
public boolean exists() {
throw new RuntimeException("Stub!");
}
There is also a message at the top of the Window that says "Sources for Android API 19 Platform not found", with links that say "Download" and "Refresh (if already downloaded)" next to it. If I click "Download", Android Studio downloads some stuff, but the problem isn't fixed and the message doesn't go away. If I click "Refresh (if already downloaded"), nothing happens.
However, if I go to one of my source files, add import java.io.File
and jump to the declaration of File.exists()
from that file, Android Studio takes me to the code
public boolean exists() {
SecurityManager security = System.getSecurityManager();
if (security != null) {
security.checkRead(path);
}
return ((fs.getBooleanAttributes(this) & FileSystem.BA_EXISTS) != 0);
}
Does anyone know what's going on here and how to fix it?