Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

AS Gradle 错误: 编码 GBK 的不可映射字符

Open
#13 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
android, java
Domain
build-system

Research direction

Start with the affected project's build.gradle and check the Gradle version involved in the report. Reproduce compilation with Chinese comments encoded as UTF-8, then verify that the project builds without the GBK unmappable-character error using the current JavaCompile configuration.

Written by the indexing model from the issue text.

Description

产生原因:

存在中文注释,且编码为utf-8。

解决方案:

指定编译字符集为utf-8。

在所在项目之下的build.gradle中添加:

tasks.withType(JavaCompile) { options.encoding = “UTF-8” }

注:由于Gradlev2.2.1的升级,语法不向下兼容。之前解决这个问题的方法是添加:

tasks.withType(Compile) { options.encoding = “UTF-8” }

Dominant language
Java
Stars
9.3k
Forks
2.1k
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GcsSloop/AndroidNote

All issues in GcsSloop/AndroidNote

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.