The problem is solved! I needed to add
implementation 'com.android.support:support-annotations:28.0.0' under
dependencies in android/app/build.gradle
in my library. The message warning was enough explicit to do that, but I didn’t think about modifying the library dependencies.