square / assertj-android

A set of AssertJ helpers geared toward testing Android.
https://square.github.io/assertj-android/
Apache License 2.0
1.58k stars 156 forks source link

Compilation Error: class file for android.app.TaskStackBuilder not found #24

Closed christopherperry closed 11 years ago

christopherperry commented 11 years ago

Hey guys,

First time trying to use this lib. Dropped the dependency in my pom, wrote a quick test just to inflate a View into an Activity, and assert that it isn't null. When I try to compile, I get the error:

class file for android.app.TaskStackBuilder not found

I've only tried a single assertion:

assertThat(view).isNotNull();

the error points back directly to this line.

christopherperry commented 11 years ago

I see the problem, this is an API level 16 class, so to use fest-android you have to compile on at least this API. Can you please specify this clearly on the site, and readme.

JakeWharton commented 11 years ago

You can avoid this by instantiating the assertions directly rather than using the static convenience methods.

christopherperry commented 11 years ago

Still, you guys should document this.

JakeWharton commented 11 years ago

Are you running on JVM or Dalvik?

JakeWharton commented 11 years ago

Ah, that's stupid. We'll hide it somewhere in the README.

JakeWharton commented 11 years ago

9bb47ca6f93d16538ad90b6f2f6df9911a3f52b2

christopherperry commented 11 years ago

Nice, thanks Jake.