[JAVA] [Android Studio] If you think you can't find the latest Support Library, you can find it.

Introduction

When I checked each library provider to update the library for the first time in a long time, the ** Android Support Library ** was updated. It was also changed from the Beta version to the Release version, so this is a bad guy to put in.

Immediately rewrite the character string * 26.0.0-alpha1 *, which has a Beta feeling, to * 26.1.0 * and click Sync Now ...

Failed to resolve: com.android.support:support-v4:26.1.0
- Install Repository and sync project
- Show in File
- Show in Project Structure dialog

why.

I looked it up a lot, but the official page only says something like "Download from the maven repository from now on!", So it's refreshing what to do.

But a kind person wrote it firmly on the bulletin board, so share it with everyone ...

Current status

build.gradle(Project)


buildscript {
  repositories {
    jcenter()
  }
  dependencies {
    classpath 'com.android.tools.build:gradle:2.3.3'
  }
}

allprojects {
  repositories {
    jcenter()
  }
}

build.gradle(app)


apply plugin: 'com.android.application'

android {
  compileSdkVersion 26
  buildToolsVersion "26.0.1"
  defaultConfig {
    ...
    targetSdkVersion 26
    ...
  }
  buildTypes {
    ...
  }
}

dependencies {
  compile fileTree(include: ['*.jar'], dir: 'libs')
  compile 'com.android.support:appcompat-v7:26.0.0-alpha1' // -> 26.1.0
  compile 'com.android.support:support-v4:26.0.0-alpha1' // -> 26.1.0
  compile 'com.android.support:design:26.0.0-alpha1' // -> 26.1.0
}

change point

As I wrote at the beginning, all I have to do is "make access to google's maven repository". I just added one line ...

build.gradle(Project)


buildscript {
  repositories {
    jcenter()
  }
  dependencies {
    classpath 'com.android.tools.build:gradle:2.3.3'
  }
}

allprojects {
  repositories {
    jcenter()
    maven { url 'https://maven.google.com' } //change point
  }
}

in conclusion

Even though the official website says "Add maven repository", if you jump to the link below it, the conventional method (non-maven) is shown, and it feels like something.

Recommended Posts

[Android Studio] If you think you can't find the latest Support Library, you can find it.
3 ways to import the library in Android Studio
[Android studio / Java] What you don't understand when you touch it for the first time
You can do it with copy! Aspect-oriented programming (Android)
What to do if you can't use the rails command