< expr>预期得到了吗? [英] <expr> expected, got '?'

查看:94
本文介绍了< expr>预期得到了吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android Studio中的类中将SQLite语句作为字符串文字键入时,IDE会向我发出以下警告:"<expr> expected, got '?'".

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.

Android Studio的版本为3.0.一堆不同的语句正在发生,但是一个典型的语句看起来像这样:

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(?,?)"
);

推荐答案

这是Android Studio 3.0中的错误,并且已经报告

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.

由于将不再有3.0补丁程序,您现在所能做的就是采用变通办法或禁用此皮棉检查.

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.

这篇关于&lt; expr&gt;预期得到了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆