androidstdio安装过程中解决的问题

1.安装目录的bin目录下,修改idea.properties文件,末尾增加:disable.android.first.run=true

2.gradle配置:

androidstdio安装过程中解决的问题_第1张图片

3.gradle的扩展版本和gradle的版本需要对应

project的build.gradle:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'

        // 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
}
3.build.gradle中的test模块可以去掉

4.app的build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId "com.example.liguoqiang.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'
        }
    }
    android { compileOptions.encoding = "UTF-8" }
}

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.3.1'
    testCompile 'junit:junit:4.12'
}
里面增加了utf-8编码

javalib的build.gradle:

apply plugin: 'java'

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
}

sourceCompatibility = "1.7"
targetCompatibility = "1.7"

tasks.withType(JavaCompile) {
    options.encoding = "UTF-8"
}
里面增加了utf-8编码

4.设置中的编码类型都为utf-8

5.安装完成后,更新一下plugins

6.进入到项目目录,运行 gradlew task

7.重要提示:gradle插件版本和gradle版本 要对应上

你可能感兴趣的:(android,java)