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

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

  • 相关阅读:
    数组
    做了个进制转换图
    类的练习
    3.10l练习
    c#学习第二课
    c#第四课习题
    c#学习第三课
    学习PHP&MYSQL之——字符编码篇(一)
    中缀表达式转换成后缀表达式
    模板方法模式(Template Pattern)
  • 原文地址:https://www.cnblogs.com/zhujiabin/p/6019741.html
Copyright © 2011-2022 走看看