When typing a SQLite statement as a string literal in a class in Android Studio, the IDE gives me this warning: "<expr> expected, got '?'"
.
I don't understand what this means, but the code is working fine, and I'd like to disable the inspection. But I don't know which inspection is causing it. There are thousands of them, and searching for or expected yields no useful results.
The version of Android Studio is 3.0. It's happening with a whole bunch of different statements, but a typical one looks like this:
SQLiteStatement st = db.compileStatement( "INSERT OR REPLACE INTO routes(route_code, route_desc) VALUES(?,?)" );
This is a bug in Android Studio 3.0 and is already reported here. Also this is now fixed in the 3.1 version. I am using the latest Canary 5 3.1 build and it works fine.
Since there are not going to be anymore 3.0 patches, all you can do for now is to go with the workaround or disable this lint check.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With