Glacier960 / android-test-kit

Automatically exported from code.google.com/p/android-test-kit
0 stars 0 forks source link

Using hamcrest 1.1 causes dexing problems #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Dependencies:
instrumentTestCompile "com.squareup.dagger:dagger-compiler:1.1.0"
    instrumentTestCompile "com.squareup.dagger:dagger:1.1.0"
    instrumentTestCompile "com.google.code.findbugs:jsr305:2.0.1"
    instrumentTestCompile "javax.annotation:javax.annotation-api:1.2"
    instrumentTestCompile "com.google.guava:guava:14.0.1"
    instrumentTestCompile fileTree(dir: 'src/instrumentTest/libs', include: '*.jar') <- espresso library
    instrumentTestCompile "org.hamcrest:hamcrest-all:1.1"
2. ./gradlew clean connectedInstrumentTest

Causes:
EXCEPTION FROM SIMULATION:
local variable type mismatch: attempt to set or access a value of type 
java.lang.Object using a local variable of type int. This is symptomatic of 
.class transformation tools that ignore local variable information.

...at bytecode offset 0000001b
locals[0000]: Lorg/hamcrest/generator/qdox/parser/impl/JFlexLexer;
locals[0001]: I
locals[0002]: [C
locals[0003]: [C
locals[0004]: [I
locals[0005]: [I
locals[0006]: <invalid>
locals[0007]: <invalid>
locals[0008]: <invalid>
locals[0009]: <invalid>
locals[000a]: <invalid>
locals[000b]: <invalid>
locals[000c]: <invalid>
locals[000d]: <invalid>
locals[000e]: <invalid>
locals[000f]: <invalid>
locals[0010]: <invalid>
stack[top0]: [B
...while working on block 001b
...while working on method yylex:()I
...while processing yylex ()I
...while processing org/hamcrest/generator/qdox/parser/impl/JFlexLexer.class

What is the expected output? What do you see instead?
Should sucess

What version of the product are you using? On what operating system?
1. Gradle with plugin: 0.6.+
2. buildToolsVersion "18.1.1"

Please provide any additional information below.
Upgrading hamcrest to 1.3 resolving this issue but espresso change is required:
You can look at: 
https://github.com/jacek-marchwicki/AndroidTestKit/commits/master

You can use this patch if you would like I have signed Google CLA

Original issue reported on code.google.com by jacek.ma...@gmail.com on 29 Oct 2013 at 10:44

GoogleCodeExporter commented 9 years ago
This is coming from hamcrest-generator. Hamcrest-generator is a CLI tool which 
generates static factory classes. As such it really shouldn't be going into 
your runtime dependencies - since it's a build time tool.

Our hamcrest dependencies are:
hamcrest-core
hamcrest-integration
hamcrest-library

Thanks for offering the hamcrest 1.3 patch. However - we need to do some 
janitorial work internally (but actually external to espresso) to upgrade from 
1.1 to 1.3. As such we'll need to wait a bit.

Original comment by thoma...@google.com on 5 Nov 2013 at 7:49

GoogleCodeExporter commented 9 years ago
I'm marking this won't fix because it should work if you do not put 
hamcrest-generator in your runtime class path. If you still have issues please 
let me know.

1.1 to 1.3 is a whole different can of worms.

Original comment by thoma...@google.com on 5 Nov 2013 at 7:51