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

java.lang.NoSuchMethodError in attempt to make the project #114

Closed
westward opened this issue Feb 3, 2015 · 1 comment
Closed

java.lang.NoSuchMethodError in attempt to make the project #114

westward opened this issue Feb 3, 2015 · 1 comment

Comments

@westward
Copy link

westward commented Feb 3, 2015

Hi,
Yesterday I finished migrating my project to Dagger2 from Dagger1, except a few errors with @singleton annotations. I commented all of them, project was built and successfully launched on Android emulator and I leave the resolving an issue with singleton annotation for today's evening. Unfortunately today, when I uncommented back @singleton annotations in the application-wide @component interface and tried to build the project, it fails with the following message:

Error:Execution failed for task ':nt2:compileDebugJava'.

java.lang.NoSuchMethodError: com.google.auto.common.MoreTypes.asTypeElements(Ljavax/lang/model/util/Types;Ljava/lang/Iterable;)Lcom/google/common/collect/ImmutableSet;

Attempts to clean, rebuild, invalidate project, comment @singleton annotations back was unsuccessful. I can delete AppComponent.java file, but in this case compiler complains for missed class that it can resolve in module, application and activity classes.

I noticed that MoreTypes is a class of com.google.auto project. Checked its sources on GitHub and can't find the method asTypeElements() with 2 arguments of type Types and Iterable. Looks like AndroidStudio downloaded the (latest?) snapshot version of com.google.auto project to resolve dependency required by Dagger2, but two-argument version of AsTypeElements method is no more present there.

Can you please provide any solution to fix this issue?

@JakeWharton
Copy link

Dupe #113.

@cgruber cgruber closed this as completed Feb 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants