无法解析条形码活动中的符号

时间:2018-01-08 16:27:30

标签: java android barcode symbols google-vision

我正在尝试在我的应用程序中实现谷歌的条形码扫描程序。

以下代码调用条形码活动:

 -r, --reset
              Unsets any user-specified developer directory, so that the developer directory will be found via the default search mechanism. This command must  be
              run with superuser permissions (see sudo(8)), and will affect all users on the system.

然后跳转到Activity.java代码的这一部分:

enter image description here

它抛出标志public void onClick(View v) { if (v.getId() == R.id.read_barcode) { Intent intent = new Intent(this, BarcodeCaptureActivity.class); intent.putExtra(BarcodeCaptureActivity.AutoFocus, autoFocus.isChecked()); intent.putExtra(BarcodeCaptureActivity.UseFlash, useFlash.isChecked()); startActivityForResult(intent, RC_BARCODE_CAPTURE); } } 并返回到调用函数,然后它与指向XML文件的Source code does not match byte code崩溃。

进一步检查时,许多进口都是红色的:

enter image description here

因此,Activity.java上有许多错误标志。代码仍会编译并运行,直到InflationException方法被命中。我尝试在SO上关注thisthis但没有成功。 TIA

1 个答案:

答案 0 :(得分:0)

您应该使用与Gradle文件中的compileSdkVersion具有相同api级别的Android模拟器(或实际设备)。