android studio中文件亂碼問題

從外導入工程,java文件中有中文,出現亂碼,在app\build.gradle中修改以下,再sync now一次即正常:java

ndroid {
    compileSdkVersion 23
    buildToolsVersion "26.0.2"

    defaultConfig {
        applicationId "com.cvr.cvr100u_demo"
        minSdkVersion 15
        targetSdkVersion 15
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
//下面就是要增長的地方
   **_ compileOptions {

        encoding "GBK"

    }_**
}
相關文章
相關標籤/搜索