Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoClassDefFoundError in project which uses Dagger #111

Open
GoogleCodeExporter opened this issue May 26, 2015 · 15 comments
Open

NoClassDefFoundError in project which uses Dagger #111

GoogleCodeExporter opened this issue May 26, 2015 · 15 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?

Project uses these dependencies for tests:

Instructions used for build configuration: 
https://code.google.com/p/android-test-kit/wiki/EspressoSetupInstructions

dependencies {
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.0') {
        exclude group: 'com.squareup.dagger'
    }
    androidTestCompile 'com.android.support.test:testing-support-lib:0.1'
}

Also I tried without excluding 'com.squareup.dagger'

After I run tests i get `java.lang.NoClassDefFoundError` and it seems like 
Dagger didn't generate needed classes:

 java.lang.NoClassDefFoundError: com/*/*/a/*AppModule$$ModuleAdapter$ProvideApplicationProvidesAdapter
            at com.*.*.a.*AppModule$$ModuleAdapter.getBindings(*AppModule$$ModuleAdapter.java:28)
            at com.*.*.a.*AppModule$$ModuleAdapter.getBindings(*AppModule$$ModuleAdapter.java:13)
            at dagger.ObjectGraph$DaggerObjectGraph.makeGraph(ObjectGraph.java:185)
            at dagger.ObjectGraph$DaggerObjectGraph.access$000(ObjectGraph.java:138)
            at dagger.ObjectGraph.create(ObjectGraph.java:129)
            at com.*.*.a.*Application.buildObjectGraphAndInject(*Application.java:30)
            at com.*.*.a.*Application.onCreate(*Application.java:26)

What is the expected output? What do you see instead?
Tests run corretly.

What version of the product are you using? On what operating system?

'com.android.support.test.espresso:espresso-core:2.0'
'com.android.support.test:testing-support-lib:0.1'

Please provide any additional information below.

Tests run corretly if I use these dependencies instead:

    androidTestCompile 'com.android.support.test:testing-support-lib:0.1'
    androidTestCompile 'org.hamcrest:hamcrest-integration:1.1'
    androidTestCompile 'org.hamcrest:hamcrest-core:1.1'
    androidTestCompile 'org.hamcrest:hamcrest-library:1.1'
    androidTestCompile 'com.google.guava:guava:18.0'
    androidTestCompile files('testLibs/espresso-core-2.0.jar')
    androidTestCompile files('testLibs/espresso-contrib-2.0.jar')

Original issue reported on code.google.com by froger.mcs on 22 Dec 2014 at 9:33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant