Android studio 配置file encoding 无效,中文乱码解决办法
2023-09-11 14:18:38 时间
通过配置Android studio 配置file encoding 无效,中文乱码,问题出现在java编译的时候jack采用了默认编码(中文windows默认的GBK编码)而乱码,所以不管更改build.gradle 中的哪种编码
tasks.withType(JavaCompile) {
options.encoding = "utf-8"
}
以及 compileOptions.encoding="UTF-8" 均会乱码,原因如下:
Jack has been using the default VM encoding, which on windows is windows-1252.
解决办法:
找到项目根目录的gradle.properties文件,增加以下一行配置(若之前存在,则注释掉)
org.gradle.jvmargs=-Dfile.encoding=UTF-8
相关文章
- [Android Pro] android 禁用和开启四大组件的方法(setComponentEnabledSetting )
- Android教程-android studio 制作.9 图片
- Failed to fetch URl https://dl-ssl.google.com/android/repository/addo Android SDK更新以及ADT更新出现问题的解决办法
- Android API之android.widget.Filterable
- Android API之android.provider.ContactsContract.RawContacts
- Android API之android.view.View.MeasureSpec
- Android开发学习---使用Intelij idea 13.1 进行android 开发
- Android中流式布局和热门标签
- macos安装android studio(Android Studio 2021.1.1)
- android 编程时,如何在Eclipse中查看Android源码或者第三方组件包源码
- Android--Dialog对话框
- Android API 中文 (42) —— ListView
- Android 中文 API (36) —— Toast
- Android 2.3 r1 中文 API (57) —— ScaleGestureDetector
- Android 中文 API (93) —— BaseExpandableListAdapter
- Android中文API (110) —— CursorTreeAdapter
- Android中文API(128) —— HandlerThread
- macos安装android studio(Android Studio 2021.1.1)
- Android stuido 解决Caused by: android.view.InflateException: Binary XML file line #8: Binary XML file
- Android【报错】. lang。android.app ClassCastException。SharedPreferencesImpl不能被强制转换为android.content.Shared
- android 11.0 12.0控制Camera开启功能实现
- Android 9.0 10.0代码设置系统默认语言为中文
- Android 用MediaCodec实现视频硬解码
- 使用Android Studio build tensorflow/examples/android——直接用android studio即可
- Android高级开发面试题以及笞案整理
- Android Studio 4.2.2 Kotlin的import kotlinx.android.synthetic.main.(layout的xml名).view.*
- Android Studio的报错提示:android.content.res.Resources$NotFoundException: Resource ID #0xfffffe6c
- Android开发问题集锦九--获取系统应用与服务
- android开发,开发环境(Android Studio)安装