Dolphin版Android Studio导入Kotlin项目遇URISyntaxException异常
Android Studio Dolphin版本导入Kotlin项目构建失败解决办法
问题定位
构建失败的核心原因是仓库地址包含非法字符:https://maven .google.com中maven与.google.com之间多了一个空格,导致URI解析时触发语法异常。
解决步骤
- 打开项目根目录下的**项目级
build.gradle**文件(注意区别于app模块下的同名文件) - 定位到
repositories代码块,找到包含错误地址的配置行 - 将
https://maven .google.com修改为正确的https://maven.google.com(或官方推荐的https://dl.google.com/dl/android/maven2/) - 保存文件后,点击Android Studio工具栏的「Sync Project with Gradle Files」按钮重新同步项目
错误日志参考
FAILURE: Build failed with an exception. * What went wrong: java.net.URISyntaxException: Illegal character in authority at index 8: https://maven .google.com Illegal character in authority at index 8: https://maven .google.com * Try: > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. * Exception is: com.intellij.openapi.externalSystem.model.ExternalSystemException: java.net.URISyntaxException: Illegal character in authority at index 8: https://maven .google.com Illegal character in authority at index 8: https://maven .google.com at org.jetbrains.plugins.gradle.model.ProjectImportAction.addBuildModels(ProjectImportAction.java:346) at org.jetbrains.plugins.gradle.model.ProjectImportAction.execute(ProjectImportAction.java:127) at org.jetbrains.plugins.gradle.model.ProjectImportAction.execute(ProjectImportAction.java:42) at * Get more help at https://help.gradle.org BUILD FAILED in 24s
内容的提问来源于stack exchange,提问作者Hubby Tiwari
相关产品推荐
相关产品推荐

