How to install Repository com.android.support:appc

2019-07-26 07:10发布

I have an error in my gradle script:

enter image description here

In my app (gradle) I have:

buildToolsVersion "25.0.2"

How can I install the corresponding appcompat lib ? When tryping to add ...

compile 'com.android.support:appcompat-v7:25.0.2'

... I get an error and the following picture :

enter image description here

When clicking on the link, nothing happens. Can someone guide me to install the lib ?

UPDATE Following screenshot shows, I obviously installed the support libraries, but then how can I get rid of the red line ? What about this ? I happens sometimes, that when publishing to google play, some libraries are missing. I can't recognize this in my local installation, but after publishing, lots of users reporting class not found. After cleaning and rebuilding and republishing it works. So I like to have a clean gradle script.

Can someone guide me , how I get rid of this red line. Or can we just ignore it ?

I am also not able to start SDK-Manager from C:\Users\andreas\AppData\Local\Android\Sdk\tools\bin directly.

Is it really not possible to solve this ?

enter image description here

3条回答
在下西门庆
2楼-- · 2019-07-26 07:23

This is most likely happen try to remove gradle folder from window c:/user/gradle, and restart setup again.

查看更多
淡お忘
3楼-- · 2019-07-26 07:25

Try this:

1) tools -> android -> sdk manager -> Launch Standalone SDK Manager

menu

standalone sdk manager

2) find "extras -> Android support repository" and check it (uncheck other for faster installing)

3) click install

Tip: Also use File -> Invalidate Caches / Restart if android studio does something strange. It may help in some cases

Upd: As Gabriele Mariotti mentioned it only works for existing libraries :)

Upd 2: it seems that standalone version was deprecated. You can update from settings window. Standalone SDK Manager option in Android Studio 2.3

Also all com.android.compat libraries in the Gradle file should be with the same version. The last one is 25.3.1

查看更多
smile是对你的礼貌
4楼-- · 2019-07-26 07:36

This happens because the support libraries v 25.0.2 doesn't exist.
You can check here all the revisions.

Also:

How can I install the corresponding appcompat lib?

Pay attention. There isn't a relation between the version of the build tools and the support libraries.

To install the support repository just run the SDK Manager.

查看更多
登录 后发表回答