I develop a Java library that runs on the JVM as well as on Android. On Android, I use the classes android.os.Build and android.util.Log. Currently, I compile against com.google.android:android:4.1.1.4, which is very outdated.
Unfortunately, there are no newer version of the Android artifact in the Central Maven repository. As I know, Google moved to its own Maven repository: https://maven.google.com/.
However, I cannot find there any Maven artifact that contains stubs for android.os.Build and android.util.Log. Where can I find a maintained Maven artifact with stubs for both classes?
You could try
org.robolectric/android-all, from robolectric.org, a framework that allows you to run Android tests directly on the JVM. It included stubs for many Android classes.Remember, Robolectric is primarily intended for testing, so it is included with the
testscope. If you need these stubs for non-testing purposes, you may need to adjust the scope or find an alternative solution.Note that, for Android development, it is generally recommended to use Android Studio and its integrated Gradle system, which has direct access to Android's Maven repository. That approach would provide you with the most up-to-date and compatible libraries for Android development.