Lately when I try debugging an android test instrumentation APK, every time the app is launched I see something like this in the logcat
W/com.myapp: Verification of void com.myapp.test.hiptest.Actionwords.function0() took 158.211ms
W/com.myapp: Verification of void com.myapp.test.hiptest.Actionwords.function1() took 101.701ms
W/com.myapp: Verification of void com.myapp.test.hiptest.Actionwords.function2() took 110.852ms
W/com.myapp: Verification of void com.myapp.test.hiptest.Actionwords.function3() took 211.494ms
W/com.myapp: Verification of void com.myapp.test.hiptest.Actionwords.function4() took 102.497ms
W/com.myapp: Verification of void com.myapp.test.hiptest.Actionwords.function5() took 126.639ms
W/com.myapp: Verification of void com.myapp.test.hiptest.Actionwords.function6() took 138.077ms
W/com.myapp: Verification of void com.myapp.test.hiptest.Actionwords.function7() took 131.311ms
W/com.myapp: Verification of void com.myapp.test.hiptest.Actionwords.function8() took 253.859ms
W/com.myapp: Verification of void com.myapp.test.hiptest.Actionwords.function9() took 111.431ms
W/com.myapp: Verification of void com.myapp.test.hiptest.Actionwords.function10() took 231.172ms
But with many more lines (for all the functions). Each function takes 100-300ms, and by the time they're all done - around 5-10 minutes have passed. (which means I can't actually do anything for these 10 minutes)
Some google searching led me to this SO thread, which explains the following:
looks like this is part of the 'backwards compatibility' requirement for the newer ART runtime. That is, apps built against DALVIK need to be able to run on ART as well.
If you run a DVM app on an ART system, you'll see this message the first time it runs when dex2oat converts the application. If you build the application targeting ART, the app will no longer be able to run on DVM, but the OAT conversion will happen during installation and is not seen at runtime.
However, I'm not sure what I'm doing wrong. Both the app and the test APKs are compiled with targetSdk 27, and minSdk 21. (and running the apps on sdk 27)
This other SO thread seems to also be similar to what I'm experiencing, but no answer is supplied.
Important: this happens only for builds that are run through the Debug toolbar icon, and not for builds that are run by clicking Run.