I've made a Library that implements androidx.annotation
but when I use that library in a app the app can't resolve annotation
.
build.gradle (Module : library)
dependencies {
implementation 'androidx.annotation:annotation:1.0.0'
}
build.gradle (Module : app)
dependencies {
implementation project(':library')
}
MainActivity.java (app)
import androidx.annotation.NonNull;
public class MainActivity extends AppCompatActivity {
// ...
@NonNull
public String getString() {
// ...
}
}
Whenever I try to Run App, it says no class found for androidx.annotation.NonNull
. I want to Include androidx.annotation
with my library. How can I do that?