Win a copy of Java Persistence with Spring Data and Hibernate this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

Debugging Android project using ant debug

 
Ranch Hand
Posts: 250
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to debug my Android project using ant debug. I am wondering where I can trace the build failure errors, where does it get displaced if there is any exception if I build project using ant debug? What is the way to trace build failure errors using this way?
 
Rancher
Posts: 43075
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure what you mean by "trace build failure errors", but if you run ant from the command line then that's where you will see all the messages, and all the errors. And if you run it in verbose mode, you'll get even more information.
 
Astha Sharma
Ranch Hand
Posts: 250
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Ulf Dittmer

Yes I'm running application using command line, but nothing is getting displayed there, no error or no other message. I want to trace the error when build gets failed during run time.
 
Ulf Dittmer
Rancher
Posts: 43075
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm confused. First you said something about "ant debug" - which is used to build the app. Now you mention running the app, and finally build ... during run time. Are you talking about build time or run time?

That ant would not print anything during an Android build is highly unusual. You're entering "ant debug", it builds the app fine, but nothing at all is displayed?
 
Astha Sharma
Ranch Hand
Posts: 250
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for giving you time Dittmer. I'm trying it for the first time using command line, so have no idea about how errors get displayed in command line. You may get better idea of what I'm asking seeing this link.
 
Ulf Dittmer
Rancher
Posts: 43075
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That page is about the ADT Eclipse plugin. Where is the connection to using the Ant build from the command line?

(My name is Ulf, by the way. If you want to address me by my last name, then that's fine, but the polite way to do so is by prefixing it by "Mr.". But first name is cool :-) )
 
Astha Sharma
Ranch Hand
Posts: 250
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks ULF
My actual problem is that I'm getting java.lang.NoClassDefFoundError: R$layout after installing ADT and SDK updates. In the link I provided, it's written that running a manual ant build resulted in a very helpful build failure error. I am just wondering does 'running a manual ant build' means running project from command line? If it is so, where can I see 'build failure error' while doing so?
 
Ulf Dittmer
Rancher
Posts: 43075
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I am just wondering does 'running a manual ant build' means running project from command line?


Yes, by running "ant debug".

If it is so, where can I see 'build failure error' while doing so?


On the command line.
 
Astha Sharma
Ranch Hand
Posts: 250
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

On the command line.


But it is not getting displayed on command line. I'm working on mac. Is there any other way to display it on mac terminal?
 
Ulf Dittmer
Rancher
Posts: 43075
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Mac Terminal *is* the command line. So that brings us back to my earlier question:

That ant would not print anything during an Android build is highly unusual. You're entering "ant debug", it builds the app fine, but nothing at all is displayed?


 
Astha Sharma
Ranch Hand
Posts: 250
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I enter "ant debug", it builds the app fine and displays whole build process with BUILD SUCCESSFUL message. It doesn't display any error. But when I run my application, it gets failed with NoClassDefFoundError error displaying in eclipse logs, showing that it's not getting the layout class in R.java. It displays-

java.lang.NoClassDefFoundError: R$layout

But doesn't display any message about this error in terminal. Neither at the time of build, nor at the time when I run the application.
 
Ulf Dittmer
Rancher
Posts: 43075
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you build it on the command line, then you shouldn't try to run it in Eclipse - those are two entirely separate environments. Install the APK file that the Ant build creates in the emulator or in an actual device and run it there.
 
I can't take it! You are too smart for me! Here is the tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic