I am using a project where Dagger2 dependency is added . My build.gradle is as follows :
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
}
}
apply plugin: 'com.android.library'
def android_support_version = '25.1.1'
configurations {
javadocDeps
}
dependencies {
compile 'com.android.support:support-annotations:' + android_support_version
compile 'com.android.support:support-v4:' + android_support_version
javadocDeps 'com.android.support:support-annotations:' + android_support_version
javadocDeps 'com.android.support:support-v4:' + android_support_version
provided 'javax.annotation:jsr250-api:1.0'
}
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
minSdkVersion 11
targetSdkVersion 25
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
test {
}
}
productFlavors {
}
}
task wrapper(type: Wrapper) {
gradleVersion = '3.1'
}
But when I want to sync gradle , then I am getting this error :
Error:(19, 13) Failed to resolve: javax.annotation:jsr250-api:1.0
<a href="disable.gradle.offline.mode">Disable offline mode and sync project</a><br><a href="openFile:F:/Android Project/stripe/build.gradle">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>
I have seen this tutorial but could not get the solution . Dagger2 dependency - Gradle
How can I solve this error ? Please help me .
Edited Question :
I have offline work checkbox unchecked . Here is the screenshot .