- 错误信息
gradle sync failed: cause: startup failed: xxx
script 1: unexpected token: < @ line 1, column 1. <!doctype html> ^ 1 errorgrad
- 源码
def versionTag = '561c2e7c'
def configUrl = "http://gitlab.xxx.xxx/${groupName}/:projectName}/raw/:commitId/:filename?private_token=xxx&ref_name=xxx"
apply from: resources.text.fromInsecureUri(configUrl)
println("config.gradle:${configUrl}")
- 错误原因
gitlab 版本升级后 api 变更了,旧的文件获取方式失效造成
- 改正
def configUrl = "http://gitlab.xxx.xxx/api/v4/projects/:id/repository/files/:file/raw?ref=master&private_token=xxx"
apply from: resources.text.fromInsecureUri(configUrl)
println("config.gradle:${configUrl}")