zoukankan      html  css  js  c++  java
  • Android 升级到Android Studio2.2 后打不开以前版本的项目

    1.找到 build.gradle 用记事本打开,修改如下:

    // Top-level build file where you can add configuration options common to all sub-projects/modules.
    
    buildscript {
        repositories {
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:2.2.0' // 我的以前为 2.1.2 ,修改这个地方
    
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }
    
    allprojects {
        repositories {
            jcenter()
        }
    }
    
    task clean(type: Delete) {
        delete rootProject.buildDir
    }

    2.找到 gradle-wrapper.properties 修改如下:

    #Mon Dec 28 10:00:20 PST 2015
    distributionBase=GRADLE_USER_HOME
    distributionPath=wrapper/dists
    zipStoreBase=GRADLE_USER_HOME
    zipStorePath=wrapper/dists
    distributionUrl=https://services.gradle.org/distributions/gradle-2.14.1-all.zip // 这个地方要看你的最新版的配置了,我的以前的为 gradle-2.10-all.zip

    3.找到 appuild.gradle 用记事本打开,修改如下:

    apply plugin: 'com.android.application'
    
    android {
        compileSdkVersion 25
        buildToolsVersion "25.0.0"
        defaultConfig {
            applicationId "com.example.administrator.myapplication"
            minSdkVersion 15
            targetSdkVersion 25
            versionCode 1
            versionName "1.0"
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }
    
    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
            exclude group: 'com.android.support', module: 'support-annotations'
        })
        compile 'com.android.support:appcompat-v7:25.0.0'
        compile 'com.android.support:design:25.0.0'
        testCompile 'junit:junit:4.12'
    }

    当然,如果你不知道自己的配置的话,可以新建一个空项目,然后查看相应文件的配置后更改

  • 相关阅读:
    CentOS7安装mysql
    centos 7 firewall(防火墙)开放端口/删除端口/查看端口
    CentOS7 FTP安装与配置
    处理nuget包太占用C盘
    windows下使用nginx
    SQL Server 设置新用户只能查看并访问特定数据库
    RPC框架
    RPC与REST
    Windows 环境下 Docker 使用及配置
    “远程调试监视器(MSVSMON.EXE)似乎没有在远程计算机上运行“的 解决方法
  • 原文地址:https://www.cnblogs.com/zhujiabin/p/6019741.html
Copyright © 2011-2022 走看看