1

我正在尝试使用 Infer 工具来分析我的应用程序代码。我按照这些步骤操作,每次尝试运行时都会出现infer -- gradle build以下错误:

infer -- gradle build
Running and capturing gradle compilation...
Traceback (most recent call last):
  File "/usr/local/bin/infer", line 183, in <module>
    main()
  File "/usr/local/bin/infer", line 147, in main
    capture_exitcode = imported_module.gen_instance(args,cmd).capture()
     File     "/usr/local/Cellar/infer/0.8.1/libexec/infer/lib/python/inferlib/capture/gradle.py", line 87, in capture
cmds = self.get_infer_commands(util.get_build_output(self.build_cmd))
   File "/usr/local/Cellar/infer/0.8.1/libexec/infer/lib/python/inferlib/capture/util.py", line 25, in get_build_output
proc = subprocess.Popen(build_cmd, stdout=subprocess.PIPE)
   File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
       File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

任何想法将不胜感激!

4

1 回答 1

2

我发现 Infer 已经包含在新的 android studio 2.2 中,您可以直接从 Analyze->Infer Nullity 运行它,然后指定范围。

在此处输入图像描述

于 2016-12-07T09:26:11.180 回答