anistn / android-test-kit

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

Update Support Annotations version used by Espresso Contrib #136

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use support annotations v22 in your app
2. Use espresso-contrib
3. Android Studio/Gradle fails

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

This is the error I get:
Warning:Conflict with dependency 'com.android.support:support-annotations'. 
Resolved versions for app and test app differ.

What version of the product are you using? On what operating system?
Android Gradle plugin 1.1.0, Android Studio 1.1.0

Original issue reported on code.google.com by bmwrac...@gmail.com on 13 Mar 2015 at 2:41

GoogleCodeExporter commented 9 years ago

Original comment by vale...@google.com on 18 Mar 2015 at 5:58

GoogleCodeExporter commented 9 years ago
Issue 139 has been merged into this issue.

Original comment by vale...@google.com on 2 Apr 2015 at 10:16

GoogleCodeExporter commented 9 years ago
Fixed in espresso 2.1

Original comment by valera.z...@gmail.com on 21 Apr 2015 at 10:11

GoogleCodeExporter commented 9 years ago
I still get this.

    Warning:Conflict with dependency 'com.android.support:support-annotations'. Resolved versions for app (22.1.0) and test app (22.0.0) differ.

Original comment by j...@squareup.com on 22 Apr 2015 at 3:40

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
The original issue was fixed but we introduced a new regression, we build 
against the old 22.0.0 and didn't upgrade to 22.1.0. Please use a resolution 
stratgey something like:

configurations.all {
    resolutionStrategy.force 'com.android.support:support-annotations:22.0.0'
    // or
   resolutionStrategy.eachDependency{...}
}

Original comment by onlythoughtworks on 22 Apr 2015 at 9:31

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I don't think the proposed resolution strategy will work if you're using any of 
the new features introduced with Support Library v22.1.0; i.e. 
AppCompatActivity. Dex will complain about resolving unexpected classes, with a 
java.lang.NoClassDefFoundError further down the line.

W/dalvikvm﹕Class resolved by unexpected DEX: 
Landroid/support/v7/app/AppCompatActivity;(0xa53f8e40):0x978a1000 ref 
[Landroid/support/v4/app/FragmentActivity;] 
Landroid/support/v4/app/FragmentActivity;(0xa53f8e40):0x97b66000
W/dalvikvm﹕ (Landroid/support/v7/app/AppCompatActivity; had used a different 
Landroid/support/v4/app/FragmentActivity; during pre-verification)
W/dalvikvm﹕ Unable to resolve superclass of 
Landroid/support/v7/app/AppCompatActivity; (315)
W/dalvikvm﹕ Link of class 'Landroid/support/v7/app/AppCompatActivity;' failed

Forcing the dependency to 22.1.0 will lead to the same problem, and bumping 
down all Support Library dependencies to 22.0.0 will obviously result in 
compile errors.

Original comment by helder.m...@gmail.com on 24 Apr 2015 at 8:28

GoogleCodeExporter commented 9 years ago
Is there an issue registered for this regression that was introduced?

Original comment by Martynas...@gmail.com on 19 May 2015 at 1:06

GoogleCodeExporter commented 9 years ago
Hi,
It's still happening with support annotations 22.2.0 and test:runner:0.2, 
espresso-core 2.1

Original comment by ima...@ambatana.com on 2 Jun 2015 at 9:07

GoogleCodeExporter commented 9 years ago
This fixed for me
Add this to your build.gradle

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.1.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
    configurations.all {
        resolutionStrategy.force 'com.android.support:support-annotations:22.1.0'
    }
}

Original comment by shiva...@triveous.com on 2 Jun 2015 at 9:10

GoogleCodeExporter commented 9 years ago
This fix works for me, espresso 2.2
Thank you.

Original comment by didin...@gmail.com on 9 Jun 2015 at 12:18

GoogleCodeExporter commented 9 years ago
This is happening again with support-annotations:22.2.1. All the support 
libraries now depend on that new version, except espresso which still depends 
on support-annotations:22.2.0

Original comment by j...@litl.com on 31 Jul 2015 at 1:59

GoogleCodeExporter commented 9 years ago
#11 Seems to be the workaround. Thanks!

Original comment by alen.siljak on 13 Aug 2015 at 10:18

GoogleCodeExporter commented 9 years ago
FI, got the same issue with support-annotation:23.0.0 and espresso which 
requires support-annotations:22.2.0.

the workaround
configurations.all {
        resolutionStrategy.force 'com.android.support:support-annotations:23.0.0'
}
did the trick, thanks !

Original comment by klein.qu...@gmail.com on 18 Aug 2015 at 6:34