2013-04-21 1 views
2

내 안드로이드 애플리케이션 통합 테스트가 있습니다. maven에서 실행하려고하면 아래 오류가 발생합니다. 나는 을 읽어야하는데, 그렇다면 "패키지를 찾을 수 없습니다"와 같은 컴파일 오류가 발생합니다 ...Robotium을 통한 Android Maven 계측 테스트 결과는 다음과 같습니다. IllegalAccessError

통합 테스트 pom.xml을 첨부합니다.

[INFO] --- android-maven-plugin:3.5.3:internal-integration-test (default-internal-integration-test) @ md-lt-tests --- 
[INFO] Found 1 devices connected with the Android Debug Bridge 
[INFO] android.device parameter not set, using all attached devices 
[INFO] Emulator emulator-5554_Test_unknown_sdk found. 
[INFO] emulator-5554_Test_unknown_sdk : Running instrumentation tests in lt.ito.md.tests 
[INFO] emulator-5554_Test_unknown_sdk :  Run started: lt.md.md.tests, 0 tests: 
[INFO] emulator-5554_Test_unknown_sdk :  Run failed: Instrumentation run failed due to 'java.lang.IllegalAccessError' 
[INFO] emulator-5554_Test_unknown_sdk :  Run ended: 0 ms 
[INFO] Tests run: 0, Failures: 0, Errors: 0 
[INFO] emulator-5554_Test_unknown_sdk : Report file written to /home/martynas/work/md-android/md/lt/lt-tests/target/surefire-reports/TEST-emulator-5554_Test_unknown_sdk.xml 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 1:20.297s 
[INFO] Finished at: Sun Apr 21 18:31:30 EEST 2013 
[INFO] Final Memory: 22M/307M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.5.3:internal-integration-test (default-internal-integration-test) on project md-lt-tests: emulator-5554_Test_unknown_sdk : Test run failed to complete: Instrumentation run failed due to 'java.lang.IllegalAccessError' 

통합 테스트 프로젝트의 pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <parent> 
     <groupId>company</groupId> 
     <artifactId>md-lt</artifactId> 
     <version>1.5.4</version> 
     <relativePath>../pom.xml</relativePath> 
    </parent> 

    <artifactId>md-lt-tests</artifactId> 
    <packaging>apk</packaging> 

    <dependencies> 
     <dependency> 
      <groupId>${project.groupId}</groupId> 
      <artifactId>md-lt-app</artifactId> 
      <version>${project.version}</version> 
      <type>apk</type> 
     </dependency> 
     <dependency> 
      <groupId>com.jayway.android.robotium</groupId> 
      <artifactId>robotium-solo</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <scope>compile</scope> 
     </dependency> 

     <dependency> 
      <groupId>android</groupId> 
      <artifactId>android</artifactId> 
      <scope>provided</scope> 
     </dependency> 
    </dependencies> 

    <build> 
    <sourceDirectory>src</sourceDirectory> 
     <finalName>${project.artifactId}</finalName> 

     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <configuration> 
        <source>1.6</source> 
        <target>1.6</target> 
        <encoding>UTF-8</encoding> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>com.jayway.maven.plugins.android.generation2</groupId> 
       <artifactId>android-maven-plugin</artifactId> 
       <version>3.5.3</version> 
       <extensions>true</extensions> 
       <configuration> 
        <sdk> 
         <platform>${android.platform.version}</platform> 
        </sdk> 
       </configuration> 
      </plugin> 
     </plugins> 
    </build> 
</project> 
+0

있어야 메모 - 모든 테 IntelliJ IDE에서 제대로 실행하십시오. –

답변

4

발견 용액 here

프로젝트 테스트 모두 apkjar 종속성 있어야 둘 측에 <scope>provided</scope>

<dependency> 
    <groupId>${project.groupId}</groupId> 
    <artifactId>md-lt-app</artifactId> 
    <version>${project.version}</version> 
    <scope>provied</scope> 
    <type>apk</type> 
</dependency> 
<dependency> 
    <groupId>${project.groupId}</groupId> 
    <artifactId>md-lt-app</artifactId> 
    <version>${project.version}</version> 
    <scope>provied</scope> 
    <type>jar</type> 
</dependency>