Disable certain Android Studio compilation errors <p>I'm extending a hidden java class so I run into the error</p> <pre><code>Error:Execution failed for task ':app:transformClassesWithInstantRunForDebug'. &gt; class com.company.class.CustomVersion cannot access its superclass java.class.JavaVersion </code></pre> <p>However, if I don't rely on Android Studio, output a jar, and then add the jar as a dependency to the same project I don't get the above compilation error and the app can launch. Since I'm writing my own library, I'd prefer not to have to create and export a jar every time I want to test some code change. Is there a way of disabling compilations errors like the above for a class?</p> <p>EDIT:</p> <p>For more information I was trying to extend a hidden Android class in the java.net package.</p>