简体   繁体   中英

Android Studio can't find Android Support Library classes

I was using Android SDK 25, but due to a bug with SDK 24 and above, I've reverted back to SDK 23. I was also using support library v25 too. I needed to revert back to support library v23.x as otherwise Gradle gave an error telling that support library major version can't be higher than the SDK version.

I've tried many different versions from Android Support Library Revision History in Gradle, but now, when I try to build my project, Android Studio can't find any of the library classes:

在此处输入图片说明

The error list goes on for anything from support library.

I've tried the answer to Android Studio can't find library classes after Gradle build and I've also tried invalidating caches and restarting, but no avail, still the same. In Gradle sync, I'm not getting any errors at all.

Here is the entry in my gradle:

compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:design:23.0.0'
compile 'com.android.support:support-v4:23.0.0'

All I've done is reverting back to SDK v23. What am I doing wrong?

Check if you have downloaded the v23 dependencies in the SDK manager.

Open the SDK manager with the button on top in Android Studio, find the SDK you are using and check the boxes if they are not checked.

RecyclerView needs a separate dependency. Add

 compile 'com.android.support:recyclerview-v7:23.0.0'

to your build.gradle if you want to use it

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM