打开别人Android项目的方法

将app/src/build.gradle中的所有版本号都改为和自己对应的

apply plugin: 'com.android.application'
android {
    compileSdkVersion 26                               //指定项目的编译版本
    buildToolsVersion "26.0.2"                         //指定项目构建工具的版本
    defaultConfig {
        applicationId "com.example.uibestpractice"     //指定项目的包名
        minSdkVersion 24                               //指定项目最低兼容的Android系统版本
        targetSdkVersion 26                            //指定项目期望的Android系统版本
        versionCode 1                                  //指定项目的版本号
        versionName "1.0"                              //指定项目的版本名。在安装文件时非常重要
    }
    buildTypes {                                       //指定安装文件的相关配置
        release {                                      //指定生成正式版安装文件的配置。还有一个是debug闭包通常不写
            minifyEnabled false                        //指定是否对项目代码进行混淆
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'         //指定混淆时使用的规则文件
        }
    }
}
dependencies {                                         //指定当前项目所有的依赖关系。3.0之前是compile,3.0之后是implementation。
    implementation fileTree(dir: 'libs', include: ['*.jar'])        //本地依赖声明
    testImplementation 'junit:junit:4.12'            
    implementation 'com.android.support:appcompat-v7:26.1.0'       //远程依赖声明
    implementation 'com.android.support:recyclerview-v7:26.1.0'

文件->项目结构->Project。中的所有数据改为和自己环境一样的

标识 修改为(和自己环境一样)
Gradle version 4.1
Android Plugin Version 3.0.0
Android Plugin Repository google(), jcenter
Default Library Repository google(), jcenter

原文:https://blog.csdn.net/wutianxu123/article/details/82831588

posted @ 2019-02-21 16:58  Philtell  阅读(814)  评论(0编辑  收藏  举报