双击SDK Manager打开Android SDK Manager。
全选以下几项
创建新项目
更改gradle的地址:
更改app的build.gradle:
android { compileSdkVersion 28 buildToolsVersion '28.0.3' defaultConfig { applicationId "com.smallart.myapplication" minSdkVersion 19 targetSdkVersion 28 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } }
dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support.constraint:constraint-layout:1.0.2' compile 'com.android.support:support-v4:26.0.0-alpha1' compile 'com.android.support:support-v13:26.0.0-alpha1' compile 'com.android.support:appcompat-v7:26.0.0-alpha1' compile 'com.android.support:gridlayout-v7:26.0.0-alpha1' compile 'com.android.support:mediarouter-v7:26.0.0-alpha1' compile 'com.android.support:cardview-v7:26.0.0-alpha1' compile 'com.android.support:palette-v7:26.0.0-alpha1' compile 'com.android.support:recyclerview-v7:26.0.0-alpha1' compile 'com.android.support:support-annotations:26.0.0-alpha1' }
更改项目的build.gradle:
allprojects { repositories { maven { url 'http://repo1.maven.org/maven2' } jcenter { url "http://jcenter.bintray.com/" } google() } }
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:26.0.0-alpha1'
compile 'com.android.support:support-v13:26.0.0-alpha1'
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
compile 'com.android.support:gridlayout-v7:26.0.0-alpha1'
compile 'com.android.support:mediarouter-v7:26.0.0-alpha1'
compile 'com.android.support:cardview-v7:26.0.0-alpha1'
compile 'com.android.support:palette-v7:26.0.0-alpha1'
compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'
compile 'com.android.support:support-annotations:26.0.0-alpha1'
}