java - Uiautomator Didn't find class <class> on path DexPathList -


i developing java project in order perform automatic screenshots of android application, however, when performing uiautomator command:

adb shell uiautomator runtest autoscreenshot.jar -c test.screenshotroutine 

i getting following error:

instrumentation_result: shortmsg=java.lang.runtimeexception instrumentation_result: longmsg=didn't find class "test.screenshotroutine" on pa th: dexpathlist[[zip file "/system/framework/android.test.runner.jar", zip file "/system/framework/uiautomator.jar", zip file "/data/local/tmp/autosc reenshot.jar"],nativelibrarydirectories=[/system/lib]] instrumentation_code: 0 

i have searched everywhere , lost around 1 day around issue. seems answers around these kind of questions on 1 year old , none of solutions have worked me. have followed examples found here , here, , changed project , have following project structure:

src  |- test    |- <class extending uiautomatortestcase>    |- interfaces    |- routines    |- utils 

my ant file generating jar file following:

<?xml version="1.0" encoding="utf-8"?> <project name="autoscreenshot.makejar" basedir=".">     <property name="src.dir" value="src"/>     <property name="libs.dir" value="libs"/>     <property name="root.dir" value="build"/>     <property name="jar.dir" value="${root.dir}/jar"/>     <property name="jar.file" value="${jar.dir}/autoscreenshot.jar"/>     <property name="classes.dir" value="${root.dir}/classes"/>      <path id="jars-classpath">         <fileset dir="${libs.dir}">             <include name="*.jar"/>         </fileset>     </path>      <target name="clean">         <delete dir="${root.dir}"/>     </target>      <target name="compile">         <mkdir dir="${classes.dir}"/>         <mkdir dir="${jar.dir}"/>          <javac srcdir="${src.dir}" destdir="${classes.dir}" target="1.8" includeantruntime="false">             <classpath refid="jars-classpath"/>         </javac>         <jar jarfile="${jar.file}" basedir="${classes.dir}">             <fileset dir="${libs.dir}" includes="**/*.jar" />             <fileset dir="${classes.dir}" includes="**/*.class" />         </jar>     </target> </project> 

inside java project, have created ´libs´ folder holds:

  • android.jar;
  • junit.jar;
  • uiautomator.jar.

am missing something, missing it? if need other file consider relevant, please feel free ask.

update #1 - add batch file content

here have in batch file i've done in order compile , upload jar file

@echo off echo cleaning project call ant clean  echo compiling jar file call ant compile  echo pushing jar file device call adb push "d:\workspaces\...\build\jar\autoscreenshot.jar" /data/local/tmp/  echo executing jar file on device call adb shell uiautomator runtest /data/local/tmp/autoscreenshot.jar -c test.screenshotroutine#runroutine -e lang en 

many in advance.


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -