One of my application suddenly fails on startup, with the following error message :
java.lang.VerifyError: Rejecting class com.sample.BufferManagerImpl because it failed compile-time verification (declaration of 'com.sample.BufferManagerImpl' appears in /data/app/com.sample.myapp-1/base.apk)
It only fails on devices using the ART virtual machine, but not on Dalvik
The issue is due to having a
synchronized
block inside atry-catch
block, for example :Apparently this is not a good practice, but as soon as I change it like this it works :