解决ERROR: Cause: invalid type code: 2D
自己在新建Kotlin工程文件时遇见了这个错误,通过在build.gradle(Project) 中添加了阿里云库解决了这个错误。
maven { url 'https://maven.aliyun.com/repository/public/' }
maven { url 'https://maven.aliyun.com/repository/google' }
build.gradle(Project) 代码:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
maven { url 'https://maven.aliyun.com/repository/public/' }
maven { url 'https://maven.aliyun.com/repository/google' }
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url 'https://maven.aliyun.com/repository/public/' }
maven { url 'https://maven.aliyun.com/repository/google' }
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
本文介绍了一种在Kotlin项目中遇到ERROR:Cause:invalidtypecode:2D问题的解决方案。作者通过在build.gradle(Project)文件中添加阿里云库,成功解决了该错误,确保了项目的正常构建。





