导入步骤
- 修改gradle.build文件中的,结合个人环境设置
classpath 'com.android.tools.build:gradle:3.2.0'
compileSdkVersion 27
buildToolsVersion "28.0.2"
2. 修改文件 gradle-wrapper.properties,指定gradle版本
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
3. 设置gradle加载方式为使用本地加载,不怕龟速想下载了就不用设置,
file-setting-gradle-use local gradle distribution
C:/Users/Administrator/.gradle/wrapper/dists/gradle-4.6-all/bcst21l2brirad8k2ben1letg/gradle-4.6
4. 添加仓库
repositories { maven { url 'http://maven.aliyun.com/nexus/content/groups/public' } maven { url 'https://dl.google.com/dl/android/maven2/' } jcenter() }
5. 修改依赖
implementation 'com.android.support:appcompat-v7:27.1.1'