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

Warning assertj-android-appcompat-v7 depends on one or more Android Libraries but is a jar #180

Open ylogx opened 9 years ago

ylogx commented 9 years ago

I keep getting the following warning:

WARNING: Module 'com.squareup.assertj:assertj-android-design:1.1.1' depends on one or more Android Libraries but is a jar
WARNING: Module 'com.squareup.assertj:assertj-android-support-v4:1.1.1' depends on one or more Android Libraries but is a jar
WARNING: Module 'com.squareup.assertj:assertj-android-appcompat-v7:1.1.1' depends on one or more Android Libraries but is a jar
JakeWharton commented 9 years ago

We ship aars. Are you explicitly depending on the jars?

ylogx commented 9 years ago

Nope. I just added these as dependencies in gradle

JakeWharton commented 9 years ago

How? Show the dependency declarations.

On Sat, Nov 28, 2015, 4:57 AM Shubham Chaudhary notifications@github.com wrote:

Nope. I just added these as dependencies in gradle

— Reply to this email directly or view it on GitHub https://github.com/square/assertj-android/issues/180#issuecomment-160270737 .

ylogx commented 9 years ago

This is the combination that fails:

    testCompile 'com.squareup.assertj:assertj-android:1.1.1'
    testCompile 'com.squareup.assertj:assertj-android-design:1.1.1'
    testCompile 'com.squareup.assertj:assertj-android-appcompat-v7:1.1.1'
    testCompile 'com.squareup.assertj:assertj-android-support-v4:1.1.1'

Just tried to reproduce again. Same steps. Add all together. Just adding testCompile 'com.squareup.assertj:assertj-android:1.1.1' works like a charm

jdulaney commented 9 years ago

I ran into the same issue. I solved it by doing the following:

testCompile("com.squareup.assertj:assertj-android:1.1.1") {
    exclude group: "com.android.support", module: "support-annotations"
    exclude group: "com.android.support", module: "support-v4"
}

testCompile("com.squareup.assertj:assertj-android-support-v4:1.1.1") {
    exclude group: "com.android.support", module: "support-annotations"
    exclude group: "com.android.support", module: "support-v4"
}
dadouf commented 8 years ago

I'm adding my two cents: I ran into a similar issue (same error message but with assertj-android-recyclerview-v7). I solved it by declaring my dependency with @aar, so:

testCompile 'com.squareup.assertj:assertj-android-recyclerview-v7:1.1.1@aar'

instead of

testCompile 'com.squareup.assertj:assertj-android-recyclerview-v7:1.1.1'