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

is Infer support ant builder for android projects? #53

Closed
ahmtbrk opened this issue Jun 14, 2015 · 13 comments
Closed

is Infer support ant builder for android projects? #53

ahmtbrk opened this issue Jun 14, 2015 · 13 comments
Labels

Comments

@ahmtbrk
Copy link

ahmtbrk commented Jun 14, 2015

I want to analyze that I write android project with eclipse(use ant).
is it possible via infer?
Good works

@jvillard
Copy link
Contributor

Hi @ahmtbrk,

Thanks for your report. Infer supports ant. You can run Infer on your ant project with

ant clean
infer -- ant compile

You can replace ant compile with the ant command you use to build your project.

We'll add these steps to the website. Let me know if they work for you.

@ahmtbrk
Copy link
Author

ahmtbrk commented Jun 14, 2015

Hi @jvillard
Thanks for help.
But i got a error during ant clean

/Users/AhmtBrK/Library/Android/sdk/tools/ant/build.xml:470: The following error occurred while executing this line:
Target "nodeps" does not exist in the project "null".

@jvillard
Copy link
Contributor

Sorry, I wrote ant clean but you should use the command you normally use to clean your project. It looks like in Eclipse this is "Project -> Clean...".

@ahmtbrk
Copy link
Author

ahmtbrk commented Jun 14, 2015

Okey.I used clean via Eclipse.After i tried infer -- ant compile and i got error again.

macbook-MacBook-Pro:AkilliEv AhmtBrK$ infer -- ant compile

BUILD FAILED
Target "compile" does not exist in the project "SplashActivity".
at org.apache.tools.ant.Project.tsort(Project.java:1929)
at org.apache.tools.ant.Project.topoSort(Project.java:1837)
at org.apache.tools.ant.Project.topoSort(Project.java:1800)
at org.apache.tools.ant.Project.executeTarget(Project.java:1376)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
at org.apache.tools.ant.Main.runBuild(Main.java:853)
at org.apache.tools.ant.Main.startAnt(Main.java:235)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:285)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:112)

Total time: 0 seconds

@jvillard
Copy link
Contributor

I am not very familiar with ant builds generated from Eclipse, sorry. Does infer -- ant work for you? Or perhaps infer -- ant -f build.xml?

@ahmtbrk
Copy link
Author

ahmtbrk commented Jun 14, 2015

No problem @jvillard.
I used infer -- ant and infer -- ant -f build.xml but terminal moved to the bottom line(new line).

Like this;
macbook-MacBook-Pro:AkilliEv AhmtBrK$ infer -- ant
macbook-MacBook-Pro:AkilliEv AhmtBrK$

@jvillard
Copy link
Contributor

Looks like an issue with infer. Does ant on its own build anything after cleaning in Eclipse?

@ahmtbrk
Copy link
Author

ahmtbrk commented Jun 14, 2015

Hi @jvillard

i ran this command only "ant"

Output;
macbook-MacBook-Pro:AkilliEv AhmtBrK$ ant
Buildfile: /Users/AhmtBrK/Documents/SmartHomeWorkspace/akilli-ev-android/AkilliEv/build.xml

help:
[echo] Android Ant Build. Available targets:
[echo] help: Displays this help.
[echo] clean: Removes output files created by other targets.
[echo] This calls the same target on all dependent projects.
[echo] Use 'ant nodeps clean' to only clean the local project
[echo] debug: Builds the application and signs it with a debug key.
[echo] The 'nodeps' target can be used to only build the
[echo] current project and ignore the libraries using:
[echo] 'ant nodeps debug'
[echo] release: Builds the application. The generated apk file must be
[echo] signed before it is published.
[echo] The 'nodeps' target can be used to only build the
[echo] current project and ignore the libraries using:
[echo] 'ant nodeps release'
[echo] instrument:Builds an instrumented package and signs it with a
[echo] debug key.
[echo] test: Runs the tests. Project must be a test project and
[echo] must have been built. Typical usage would be:
[echo] ant [emma] debug install test
[echo] emma: Transiently enables code coverage for subsequent
[echo] targets.
[echo] install: Installs the newly build package. Must either be used
[echo] in conjunction with a build target (debug/release/
[echo] instrument) or with the proper suffix indicating
[echo] which package to install (see below).
[echo] If the application was previously installed, the
[echo] application is reinstalled if the signature matches.
[echo] installd: Installs (only) the debug package.
[echo] installr: Installs (only) the release package.
[echo] installi: Installs (only) the instrumented package.
[echo] installt: Installs (only) the test and tested packages (unless
[echo] nodeps is used as well.
[echo] uninstall: Uninstalls the application from a running emulator or
[echo] device. Also uninstall tested package if applicable
[echo] unless 'nodeps' is used as well.

BUILD SUCCESSFUL
Total time: 0 seconds

but i ran "ant compile"

Output;
macbook-MacBook-Pro:AkilliEv AhmtBrK$ ant compile
Buildfile: /Users/AhmtBrK/Documents/SmartHomeWorkspace/akilli-ev-android/AkilliEv/build.xml

BUILD FAILED
Target "compile" does not exist in the project "SplashActivity".

Total time: 0 seconds

@jvillard
Copy link
Contributor

Try with one of the targets given by ant, for example ant debug. If this work, clean the project in Eclipse then run infer -- ant debug.

@ahmtbrk
Copy link
Author

ahmtbrk commented Jun 14, 2015

yeah i tried ant debug but i got an error

[aapt] invalid resource directory name: /Users/AhmtBrK/Documents/SmartHomeWorkspace/akilli-ev-android/ViewPageIndicator/bin/res crunch

BUILD FAILED
/Users/AhmtBrK/Library/Android/sdk/tools/ant/build.xml:597: The following error occurred while executing this line:
/Users/AhmtBrK/Library/Android/sdk/tools/ant/build.xml:649: The following error occurred while executing this line:
/Users/AhmtBrK/Library/Android/sdk/tools/ant/build.xml:694: null returned: 1

As far as I understand "ant debug" command is true but my project is more complex.
So I think that was a mistake.

Many thanks for the help

@irpap irpap added the java label Jun 15, 2015
@adenisonafifi
Copy link

[aapt] invalid resource directory name: /Users/AhmtBrK/Documents/SmartHomeWorkspace/akilli-ev-android/ViewPageIndicator/bin/res crunch

This error normally indicates that you need to execute an ant clean.

For example: infer -- ant clean debug from the Android/ directory.

@jvillard
Copy link
Contributor

Hi @ahmtbrk, I'm closing this issue since the problem seems to be related to finding the right ant command to build your project rather than something Infer-specific.

Feel free to post the solution to your problem, or to re-open the issue if you have more questions.

@adolf2v
Copy link

adolf2v commented Oct 26, 2016

In my case , ant debug.
the following is the available targets.

 [echo]    **clean:**     Removes output files created by other targets.
                           This calls the same target on all dependent projects.
                            Use 'ant nodeps clean' to only clean the local project
 [echo]    **debug:**     Builds the application and signs it with a debug key.
                           The 'nodeps' target can be used to only build the
                            current project and ignore the libraries using:
                           'ant nodeps debug'
 [echo]    **release:**   Builds the application. The generated apk file must be
                             signed before it is published.
                            The 'nodeps' target can be used to only build the
                             current project and ignore the libraries using:
                             'ant nodeps release'
 [echo]    **instrument:**Builds an instrumented package and signs it with a
                            debug key.
 [echo]    **test:**      Runs the tests. Project must be a test project and
                               must have been built. Typical usage would be:
                              ant [emma] debug install test
 [echo]    **emma:**      Transiently enables code coverage for subsequent
                             targets.
 [echo]    **install:**   Installs the newly build package. Must either be used
                             in conjunction with a build target (debug/release/
                              instrument) or with the proper suffix indicating
                              which package to install (see below).
                            If the application was previously installed, the
                            application is reinstalled if the signature matches.
 [echo]    **installd:**    Installs (only) the debug package.
 [echo]    **installr:**     Installs (only) the release package.
 [echo]    **installi:**     Installs (only) the instrumented package.
 [echo]    **installt:**    Installs (only) the test and tested packages (unless
                                       nodeps is used as well.
 [echo]    **uninstall:** Uninstalls the application from a running emulator or
                                       device. Also uninstall tested package if applicable
                                       unless 'nodeps' is used as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants