Oleg
Oleg

Reputation: 1358

Can't update build.gradle to use support library 23.0.1

So I've updated my build.gradle file:

compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:recyclerview-v7:23.0.1'
compile 'com.android.support:cardview-v7:23.0.1'
compile 'com.android.support:design:23.0.1'

But when I try to sync the project this pops up

Error:(25, 13) Failed to resolve: com.android.support:recyclerview-v7:23.0.1
Install Repository and sync project
Show in File
Show in Project Structure dialog

(and the same for the other two repositories)

Then I try to click "Install Repository and sync project" and this error occurs:

Ignoring unknown package filter 'extra-android-m2repository'Warning: 
The package filter removed all packages. There is nothing to install.
         Please consider trying to update again without a package filter.

And install fails.

I have installed build tools 23.0.1 and everything for android M in SDK manager. Tried rolling back to 23.0.0 but it's the same.

What's wrong? Where did this package filter came from? I dont think I changed anything except for build.gradle before this error occured

EDIT: I tried to delete build tools and install them again and while installing SDK manager log popped up with this:

Preparing to install archives
Downloading Android SDK Platform-tools, revision 23.0.1
Installing Android SDK Platform-tools, revision 23.0.1
*** -> Stopping ADB server failed (code -1)
Installed Android SDK Platform-tools, revision 23.0.1
Downloading Android SDK Build-tools, revision 23.0.1
Installing Android SDK Build-tools, revision 23.0.1
Installed Android SDK Build-tools, revision 23.0.1
Stopping ADB server succeeded.
Starting ADB server succeeded.
Done. 2 packages installed.
Done loading packages.

Upvotes: 7

Views: 26448

Answers (4)

Yaks10
Yaks10

Reputation: 503

In my case Reinstalling Android Studio fixed the bug. I guess something wrong was with network.

Upvotes: 2

Ivan
Ivan

Reputation: 3062

First make sure that you set

compileSdkVersion 23
buildToolsVersion "23.0.1"

and

targetSdkVersion 23

Then press Sync Project with Gradle Files and install everything that is missing.

Next, add your

compile 'com.android.support:design:23.0.1'

and make sure that you are NOT trying to add this

compile 'com.android.support:design-v7:23.0.1'

it should work now.

Upvotes: 12

Oleg
Oleg

Reputation: 1358

Reinstalling Android Studio fixed the problem.

My guess is that Android Studio did not have internet access

Upvotes: 1

unbekant
unbekant

Reputation: 1555

Did you try updating the compileSdkVersion in your build.gradle to 23 as well?

It appears like several people are having related issues. If updating the compile sdk does not work either, maybe you can try any of the solutions in this thread: Error retrieving parent for Item - AppCompat-v7 23

Upvotes: 0

Related Questions