0

build.gradle

configurations.all {
resolutionStrategy {
    force 'com.android.support:support-annotations:23.1.1'
}}

Async Task

import android.annotation.MainThread; import android.annotation.Nullable; import android.annotation.WorkerThread;

Any idea why the above imports cannot be resolved?

Dylan
  • 375
  • 1
  • 2
  • 12

1 Answers1

1

Disclaimer: I know nothing about Android development.

In Gradle, dependencies are defined in the dependencies configuration block like this:

dependencies {
    implementation 'com.android.support:support-annotations:23.1.1'
} 

Read mir about this in the dependencies userguide.

resolutionStrategy in contrast, is used to control which version of a particular dependency to use in case a version conflict occurs (transitive dependencies) beside other use cases.

thokuest
  • 5,800
  • 24
  • 36