Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve
You might be importing Application instead of Module. Well you can change it in module's gradle also.
Change
apply plugin: 'com.android.application'
to
apply plugin: 'com.android.library'
You also need to remove applicationId from the gradle.
I just figured out how to remove this gradle error, follow the following steps.
- Go to "File".
- Click on Invalidate Cache/ Restart.
- Again click on Invalidate Cache / Restart(On dialoge window).
Let the gradle build without any interruption.
Thank You!Regards, hope this will help.
I think the problems comes from the following:The internet connection with u was unavailable so Android Studio asked you to enable the "offline work" and you just enabled it
To fix this:
- File
- Settings
- Build, Execution, Deployment
- Gradle
- Uncheck offline work
why might unchecking the offline work solves the problem, because in the Gradle sometimes some dependencies need to update (the ones containing '+'), so internet connection is needed.