{"record":{"id":"7ebdc1c95a54316f","repo":"didi/DoKit","slug":"config-gradle-archives-type-1","errorCode":null,"errorMessage":"执行当前打包上传任务必须修改config.gradle配置中的archives_type = 1。","messagePattern":"执行当前打包上传任务必须修改config\\.gradle配置中的archives_type = 1。","errorType":"console","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"Android/build.gradle","lineNumber":206,"sourceCode":"\n//        if (!modules.contains(\"dokit-rpc\")) {\n//            throw new RuntimeException(\"未找到dokit-rpc module。。。\")\n//        }\n//\n//        if (!modules.contains(\"dokit-rpc-mc\")) {\n//            throw new RuntimeException(\"未找到dokit-rpc-mc module。。。\")\n//        }\n\n        if (!modules.contains(\"dokit-plugin\")) {\n            throw new RuntimeException(\"未找到dokit-plugin module。。。\")\n        }\n    }\n}\n\ntask checkUploadConfig4Didi() {\n    doLast {\n        if (rootProject.ext.publish_config[\"archives_type\"] != 1) {\n            throw new RuntimeException(\"执行当前打包上传任务必须修改config.gradle配置中的archives_type = 1。\")\n        }\n        //仓库检查\n        def repositories = new ArrayList<String>()\n\n        rootProject.repositories.forEach {\n            if (it instanceof MavenArtifactRepository) {\n                repositories.add((it as MavenArtifactRepository).url.toString())\n            }\n        }\n\n        //相关模块检查\n        def modules = new ArrayList<String>()\n\n        rootProject.allprojects.forEach {\n            modules.add(it.name)\n        }\n\n//        if (!modules.contains(\"dokit-rpc\")) {","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/didi/DoKit/blob/626827cddb2feb2f3aee87a52a064b4e5ca2bed4/Android/build.gradle#L188-L224","documentation":"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.","triggerScenarios":"Running the Didi upload task while config.gradle still has archives_type = 0 (local) or 2 (Maven Central).","commonSituations":"Publishing sequence confusion when preparing multi-target releases (local test -> Didi -> Maven); config.gradle edits lost to a git checkout/stash.","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"],"exampleFix":"// before (config.gradle)\next.publish_config = [archives_type: 0, ...]\n\n// after (config.gradle)\next.publish_config = [archives_type: 1, ...]","handlingStrategy":"validation","validationCode":"assert rootProject.ext.publish_config[\"archives_type\"] == 1 : \"set archives_type = 1 for Didi upload\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Confirm archives_type matches the upload task every time you switch targets","Also verify repository URLs — the same task validates Maven repositories next"],"tags":["gradle","build-config","publishing","didi"],"backgroundTag":null,"analyzedSha":"626827cddb2feb2f3aee87a52a064b4e5ca2bed4","analyzedAt":"2026-08-14T12:45:58.758Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}