AndroidStudio用gradle编译中文乱码
在GradleScripts下的
build.gradle(Module:app)文件中,增加一行代码:
android { compileOptions.encoding = "GBK" }
该文件全文如下:(加粗部分是关键)
applyplugin:'com.android.application'
android{
compileSdkVersion22
buildToolsVersion"22.0.1"
android{compileOptions.encoding="GBK"}
defaultConfig{
applicationId"com.jksoft.ebooks"
minSdkVersion15
targetSdkVersion22
versionCode1
versionName"1.0"
}
buildTypes{
release{
minifyEnabledfalse
proguardFilesgetDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
}
}
dependencies{
compilefileTree(dir:'libs',include:['*.jar'])
compile'com.android.support:appcompat-v7:22.1.1'
}
相关推荐
CaesarHome 2020-11-09
chenkai00 2020-07-26
CaptainCTR 2020-07-09
afa0 2020-06-23
StephenWong 2020-06-18
chenkai00 2020-06-13
Lucianoesu 2020-06-08
tysforwork 2020-06-05
貌似掉线 2020-05-30
tysforwork 2020-05-27
CaptainCTR 2020-05-07
CaptainCTR 2020-05-04
貌似掉线 2020-05-03
CaptainCTR 2020-04-29
貌似掉线 2020-04-29
CaptainCTR 2020-04-23