Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Running the command failed" #13

Closed
infinitnet opened this issue Mar 29, 2015 · 5 comments
Closed

"Running the command failed" #13

infinitnet opened this issue Mar 29, 2015 · 5 comments
Assignees

Comments

@infinitnet
Copy link

When I run android-resource-remover inside the project directory under Ubuntu Trusty, it results in:

*Help text*
[...]
Running the command failed. Try running it from the console. Arguments for subprocess.call: ['lint', '.', '--xml', './lint-result.xml']
Traceback (most recent call last):
  File "/usr/local/bin/android-resource-remover", line 9, in <module>
    load_entry_point('android-resource-remover==0.1.0', 'console_scripts', 'android-resource-remover')()
  File "/usr/local/lib/python2.7/dist-packages/android_clean_app.py", line 137, in main
    issues = parse_lint_result(lint_result_path)
  File "/usr/local/lib/python2.7/dist-packages/android_clean_app.py", line 85, in parse_lint_result
    root = ET.parse(lint_result_path).getroot()
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1182, in parse
    tree.parse(source, parser)
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 647, in parse
    source = open(source, "rb")
IOError: [Errno 2] No such file or directory: './lint-result.xml'
@ca77y ca77y self-assigned this Mar 30, 2015
@ca77y
Copy link
Contributor

ca77y commented Mar 31, 2015

this means you dont have the result of lint command.

make sure you have lint tool in you path or specify the path to lint. you can run it separately and make sure it works.

if you're using gradle please check this info

@infinitnet
Copy link
Author

I probably should have mentioned that the same error occures even if I specify the path to lint. Therefore I didn't mention it, because I assumed it weren't relevant.

root@box:~/project# which lint
/root/android-sdk-linux//tools/lint
root@box:~/project# android-resource-remover --lint /root/android-sdk-linux//tools/lint
Namespace(app='.', ignore_layouts=False, lint='/root/android-sdk-linux//tools/lint', xml=None)
Usage: lint [flags] <project directories>

Flags:

--help                   This message.
--help <topic>           Help on the given topic, such as "suppress".
--list                   List the available issue id's and exit.
--version                Output version information and exit.
--exitcode               Set the exit code to 1 if errors are found.
--show                   List available issues along with full explanations.
--show <ids>             Show full explanations for the given list of issue
                         id's.

Enabled Checks:
--disable <list>         Disable the list of categories or specific issue
                         id's. The list should be a comma-separated list of
                         issue id's or categories.
--enable <list>          Enable the specific list of issues. This checks all
                         the default issues plus the specifically enabled
                         issues. The list should be a comma-separated list of
                         issue id's or categories.
--check <list>           Only check the specific list of issues. This will
                         disable everything and re-enable the given list of
                         issues. The list should be a comma-separated list of
                         issue id's or categories.
-w, --nowarn             Only check for errors (ignore warnings)
-Wall                    Check all warnings, including those off by default
-Werror                  Treat all warnings as errors
--config <filename>      Use the given configuration file to determine whether
                         issues are enabled or disabled. If a project contains
                         a lint.xml file, then this config file will be used
                         as a fallback.

Output Options:
--quiet                  Don't show progress.
--fullpath               Use full paths in the error output.
--showall                Do not truncate long messages, lists of alternate
                         locations, etc.
--nolines                Do not include the source file lines with errors in
                         the output. By default, the error output includes
                         snippets of source code on the line containing the
                         error, but this flag turns it off.
--html <filename>        Create an HTML report instead. If the filename is a
                         directory (or a new filename without an extension),
                         lint will create a separate report for each scanned
                         project.
--url filepath=url       Add links to HTML report, replacing local path
                         prefixes with url prefix. The mapping can be a
                         comma-separated list of path prefixes to
                         corresponding URL prefixes, such as
                         C:\temp\Proj1=http://buildserver/sources/temp/Proj1. 
                         To turn off linking to files, use --url none
--simplehtml <filename>  Create a simple HTML report
--xml <filename>         Create an XML report instead.

Project Options:
--resources <dir>        Add the given folder (or path) as a resource
                         directory for the project. Only valid when running
                         lint on a single project.
--sources <dir>          Add the given folder (or path) as a source directory
                         for the project. Only valid when running lint on a
                         single project.
--classpath <dir>        Add the given folder (or jar file, or path) as a
                         class directory for the project. Only valid when
                         running lint on a single project.
--libraries <dir>        Add the given folder (or jar file, or path) as a
                         class library for the project. Only valid when
                         running lint on a single project.

Exit Status:
0                        Success.
1                        Lint errors detected.
2                        Lint usage.
3                        Cannot clobber existing file.
4                        Lint help.
5                        Invalid command-line argument.
Running the command failed. Try running it from the console. Arguments for subprocess.call: ['/root/android-sdk-linux//tools/lint', '.', '--xml', './lint-result.xml']
Traceback (most recent call last):
  File "/usr/local/bin/android-resource-remover", line 9, in <module>
    load_entry_point('android-resource-remover==0.1.0', 'console_scripts', 'android-resource-remover')()
  File "/usr/local/lib/python2.7/dist-packages/android_clean_app.py", line 137, in main
    issues = parse_lint_result(lint_result_path)
  File "/usr/local/lib/python2.7/dist-packages/android_clean_app.py", line 85, in parse_lint_result
    root = ET.parse(lint_result_path).getroot()
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1182, in parse
    tree.parse(source, parser)
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 647, in parse
    source = open(source, "rb")
IOError: [Errno 2] No such file or directory: './lint-result.xml'
root@box:~/project#

@ca77y
Copy link
Contributor

ca77y commented Mar 31, 2015

if you run lint in your project, does it run correctly?

@infinitnet
Copy link
Author

It appears so (let me know if I should try different arguments - I'm completely new to Android development):

# lint --check MissingPrefix .

Scanning .: .........................................................................................................................
         - ActionBarSherlock: .........................................
No issues found.

@ca77y
Copy link
Contributor

ca77y commented Mar 31, 2015

fixed with 0.1.3

@ca77y ca77y closed this as completed Mar 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants