问题
I am trying to use ContextCompat class from the Android Support Library. I am using only CLI tools to build an app. So I figured I have to get a jar. I entered the following:
$ sdkmanager --list | grep extras
Warning: File /root/.android/repositories.cfg could not be loaded.
extras;android;m2repository | 47.0.0 | Android Support Repository | extras/android/m2repository/
extras;android;gapid;1 | 1.0.3 | GPU Debugging tools
extras;android;gapid;3 | 3.1.0 | GPU Debugging tools
extras;android;m2repository | 47.0.0 | Android Support Repository
$ sdkmanager "extras;android;m2repository"
$ ls /opt/android-sdk/extras/android/m2repository/com/android/support/support-v4/26.0.0-alpha1/*
-rw-r--r-- 1 root root 1767 Sep 12 16:16 /opt/android-sdk/extras/android/m2repository/com/android/support/support-v4/26.0.0-alpha1/support-v4-26.0.0-alpha1.aar
-rw-r--r-- 1 root root 32 Sep 12 16:16 /opt/android-sdk/extras/android/m2repository/com/android/support/support-v4/26.0.0-alpha1/support-v4-26.0.0-alpha1.aar.md5
-rw-r--r-- 1 root root 40 Sep 12 16:16 /opt/android-sdk/extras/android/m2repository/com/android/support/support-v4/26.0.0-alpha1/support-v4-26.0.0-alpha1.aar.sha1
-rw-r--r-- 1 root root 1572 Sep 12 16:16 /opt/android-sdk/extras/android/m2repository/com/android/support/support-v4/26.0.0-alpha1/support-v4-26.0.0-alpha1.pom
-rw-r--r-- 1 root root 32 Sep 12 16:16 /opt/android-sdk/extras/android/m2repository/com/android/support/support-v4/26.0.0-alpha1/support-v4-26.0.0-alpha1.pom.md5
-rw-r--r-- 1 root root 40 Sep 12 16:16 /opt/android-sdk/extras/android/m2repository/com/android/support/support-v4/26.0.0-alpha1/support-v4-26.0.0-alpha1.pom.sha1
-rw-r--r-- 1 root root 261 Sep 12 16:16 /opt/android-sdk/extras/android/m2repository/com/android/support/support-v4/26.0.0-alpha1/support-v4-26.0.0-alpha1-sources.jar
-rw-r--r-- 1 root root 32 Sep 12 16:16 /opt/android-sdk/extras/android/m2repository/com/android/support/support-v4/26.0.0-alpha1/support-v4-26.0.0-alpha1-sources.jar.md5
-rw-r--r-- 1 root root 40 Sep 12 16:16 /opt/android-sdk/extras/android/m2repository/com/android/support/support-v4/26.0.0-alpha1/support-v4-26.0.0-alpha1-sources.jar.sha1
The problem is, I cannot see any jar files of the latest Android Support Library. What should I do to download it?
回答1:
The folder /opt/android-sdk/extras/android/m2repository/com/android/support/support-v4/24.1.1 in my case contained about 2MB aar file, which contained classes.jar file, which I finally and ended up using. It is unclear what is the purpose of other low-size files in the other folders like 26.0.0.
来源:https://stackoverflow.com/questions/57911022/install-latest-android-support-library-cli