I\'m developing an android app please help me to solve dependency error.
package android.os;
import android.support.annotation.NonNull;
import android.suppor
Since Google announced at IO17 gradle:3.0, the compile
configuration is now deprecated and should be replaced by implementation
or api
So prefer
dependencies {
...
implementation 'com.android.support:support-annotations:27.1.1'
...
}
or greater version
As of android api 29 ('targetSdkVersion' 29) com.android.support has been moved to 'androidx' library. In your Build.gradle file(app level), dependencies block use...
dependencies{ ...
implementation 'androidx.annotation:annotation:1.1.0' }
And in your .java files use import as follows: import androidx.annotation.NonNull; ...
Again build your project!
Try:
import android.support.annotation.NonNull;
Also add gradle build as other guys already mentioned:
dependencies {
compile 'com.android.support:support-annotations:+'
}
Add following in your dependencies
compile 'com.android.support:support-annotations:+'
Also, verify this
Go to File -> Setting -> search for "nullable" and verify these settings.
Add following in your dependencies
dependencies {
compile 'com.android.support:support-annotations:+'
}