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'
    }

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

  • 相关阅读:
    算数基本定理与质因数分解
    质数的两种筛法
    质数及其判法
    二十二、Spring MVC与Structs2的区别总结
    二十一、MVC的WEB框架(Spring MVC)
    二十、MVC的WEB框架(Spring MVC)
    十九、Spring框架(注解方式测试)
    十八、Spring框架(AOP)
    十七、Spring框架(IOC/DI)
    创建型模式篇(建造者模式Builder Pattern)
  • 原文地址:https://www.cnblogs.com/zhujiabin/p/6019741.html
Copyright © 2011-2022 走看看