Install latest android support library CLI

蓝咒 提交于 2019-12-13 04:08:19

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!