Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: classdef not found error in uiautomator test app - eclipse

  1. #1
    Junior Member
    Join Date
    Dec 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default classdef not found error in uiautomator test app - eclipse

    I figure I'm doing something dumb in eclipse but I just can't figure it out.

    I'm automating an activity with uiautomator. I needed to grab some info from a custom control that stored in the apk.
    My file structure is something like this

    myApp/java/com/fancy/ui/control/theview.java
    myApp/uitests/src/com/fancy/ui/uitests.java

    I only load the myApp/uitests into my workspace, not the activity code.

    Anyhow I import the com.fancy.ui.control.theview;
    In eclipse properties Java path I pointed to the class folder since it's an apk. (this is where I plead ignorance).

    The test code I create a thread, a handler and a looper, within that handler.Post I am asking to print theview.getAdapter().getcount();

    Everything compiles and when I push the jar and run it via uiautomator - it steps into the thread but complains about com.fancy.ui.control.theview being classref not found exception. - I figure it has something to do with the Java path stuff. Perhaps even with the fact the I'm loading only the uitest into the workspace and not the activity&control.

    Any thoughts on setting it up right? Should I focus on the setting or am not allowed to access activity or controls from a thread via uiautomator?

    Happy Holidays,
    zombietoe


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    3,410
    My Mood
    Mellow
    Thanks
    85
    Thanked 473 Times in 464 Posts

    Default Re: classdef not found error in uiautomator test app - eclipse

    I assume "push the jar" means you're creating or importing the project to a .jar file from Eclipse. Is that correct? If so, I suspect that the export is going wrong in that it's not including all of the project parts needed for the resulting .jar file to stand alone.

    The Java Tutorials include a section on creating .jar files. I suggest you read that and try creating the .jar file by hand (outside Eclipse).

  3. #3
    Junior Member
    Join Date
    Dec 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: classdef not found error in uiautomator test app - eclipse

    Thanks, I failed to mention a few important things:
    1. I generated a build.xml through a script. android create uitest-project -n uitest -t 10 -p . --> the resulting file is very generic - I didn't update it.
    2. than I compile ant build in bash rather than in eclipse, I adb push the resulting jar from the bin folder.

Similar Threads

  1. Error: Main method not found! Please help!
    By adnan.alvee in forum What's Wrong With My Code?
    Replies: 12
    Last Post: March 11th, 2013, 07:03 PM
  2. Symbol not found error
    By ayuda96 in forum What's Wrong With My Code?
    Replies: 5
    Last Post: July 25th, 2012, 04:48 PM
  3. multiple annottions found error in jsp page with eclipse
    By sfdcmallik in forum JavaServer Pages: JSP & JSTL
    Replies: 1
    Last Post: May 9th, 2012, 08:40 PM
  4. neep a very simple app (in eclipse)
    By Rao1977 in forum Android Development
    Replies: 0
    Last Post: April 18th, 2012, 04:37 PM
  5. Any alternative of Eclipse for developing android app?
    By vincentroberts in forum Java IDEs
    Replies: 6
    Last Post: January 5th, 2012, 12:48 AM