推断 - gradle构建不起作用

时间:2016-07-10 11:46:07

标签: android facebook-infer

我试图使用推断工具来分析我的应用代码。我跟着these steps,每次我试图运行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

任何想法都将不胜感激!!

1 个答案:

答案 0 :(得分:2)

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

enter image description here