AndroidStudio用gradle编译中文乱码
16lz
2021-12-04
在Gradle Scripts下的
build.gradle(Module:app)文件中,增加一行代码:
该文件全文如下:(加粗部分是关键)
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
android { compileOptions.encoding = "GBK" }
defaultConfig {
applicationId "com.jksoft.ebooks"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.1.1'
}
build.gradle(Module:app)文件中,增加一行代码:
android { compileOptions.encoding = "GBK" }
该文件全文如下:(加粗部分是关键)
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
android { compileOptions.encoding = "GBK" }
defaultConfig {
applicationId "com.jksoft.ebooks"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.1.1'
}
更多相关文章
- python list.sort()根据多个关键字排序的方法实现
- android webview 使用js加载json文件失败
- Android中动态添加╱删除的Spinner菜单
- Android的自定义长按
- android style的使用
- Android上MediaScanner是如何工作的
- android中调用金山词霸
- 新建ArcGIS Project for Android项目失败解决方案
- Android学习笔记(九)之Android(安卓)获取正在运行的Activity