didi/DoKit · error · RuntimeException
执行当前打包上传任务必须修改config.gradle配置中的archives_type = 1。
Error message
执行当前打包上传任务必须修改config.gradle配置中的archives_type = 1。
What it means
The checkUploadConfig4Didi Gradle task in Android/build.gradle throws a RuntimeException when rootProject.ext.publish_config['archives_type'] != 1. It guards the Didi-internal-repository publishing path, requiring config.gradle to be explicitly set to archives_type = 1 before uploading to Didi's Maven repo.
Source
Thrown at Android/build.gradle:206
// if (!modules.contains("dokit-rpc")) {
// throw new RuntimeException("未找到dokit-rpc module。。。")
// }
//
// if (!modules.contains("dokit-rpc-mc")) {
// throw new RuntimeException("未找到dokit-rpc-mc module。。。")
// }
if (!modules.contains("dokit-plugin")) {
throw new RuntimeException("未找到dokit-plugin module。。。")
}
}
}
task checkUploadConfig4Didi() {
doLast {
if (rootProject.ext.publish_config["archives_type"] != 1) {
throw new RuntimeException("执行当前打包上传任务必须修改config.gradle配置中的archives_type = 1。")
}
//仓库检查
def repositories = new ArrayList<String>()
rootProject.repositories.forEach {
if (it instanceof MavenArtifactRepository) {
repositories.add((it as MavenArtifactRepository).url.toString())
}
}
//相关模块检查
def modules = new ArrayList<String>()
rootProject.allprojects.forEach {
modules.add(it.name)
}
// if (!modules.contains("dokit-rpc")) {View on GitHub (pinned to 626827cddb)
Solutions
- Set archives_type = 1 in Android/config.gradle and re-run the Didi upload
- Verify repository URLs under rootProject.repositories point at Didi's Maven repo (the same task checks them next)
- Track the value per release in your release checklist so it never lags the actual target
Example fix
// before (config.gradle) ext.publish_config = [archives_type: 0, ...] // after (config.gradle) ext.publish_config = [archives_type: 1, ...]
Defensive patterns
Strategy: validation
Validate before calling
assert rootProject.ext.publish_config["archives_type"] == 1 : "set archives_type = 1 for Didi upload"
Prevention
- Confirm archives_type matches the upload task every time you switch targets
- Also verify repository URLs — the same task validates Maven repositories next
When it happens
Trigger: Running the Didi upload task while config.gradle still has archives_type = 0 (local) or 2 (Maven Central).
Common situations: Publishing sequence confusion when preparing multi-target releases (local test -> Didi -> Maven); config.gradle edits lost to a git checkout/stash.
Related errors
- 执行当前打包上传任务必须修改config.gradle配置中的archives_type = 2。
- 执行当前打包上传任务必须修改config.gradle配置中的archives_type = 0。
- 未找到dokit-plugin module。。。
AI-assisted analysis of didi/DoKit@626827cddb (2026-08-14).
Data as JSON: /api/errors/7ebdc1c95a54316f.
Report an issue: GitHub.