Small icon indicating copy to clipboard operation
Small copied to clipboard

按照官方文档引入small的时候,总是会报kotlin的错误。不引入small,kotlin不会报错。

Open HsHWB opened this issue 4 years ago • 2 comments

Project的gradle,配置了small和kotlin

buildscript { ext.kotlin_version = "1.3.72" ext.small_version = "1.5.0-beta2" repositories { google() jcenter() } dependencies { classpath "com.android.tools.build:gradle:3.4.2" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "net.wequick.tools.build:gradle-small:$small_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } }

apply plugin: 'net.wequick.small' small { aarVersion = small_version }

app的gradle配置:

api "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

gradle跑small task的时候,异常 Execution failed for task ':small'.

Could not resolve all dependencies for configuration ':app:compile'. Could not find org.jetbrains.kotlin:kotlin-stdlib-jre7:1.3.72. Searched in the following locations: - https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-stdlib-jre7/1.3.72/kotlin-stdlib-jre7-1.3.72.pom - https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-stdlib-jre7/1.3.72/kotlin-stdlib-jre7-1.3.72.jar - https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jre7/1.3.72/kotlin-stdlib-jre7-1.3.72.pom - https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jre7/1.3.72/kotlin-stdlib-jre7-1.3.72.jar Required by: project :app

HsHWB avatar Feb 07 '21 07:02 HsHWB

处理了吗?我这边也报这个错

newcman avatar May 28 '21 03:05 newcman

buildscript { ext.kotlin_version = "1.3.72" repositories { google() jcenter() } dependencies { classpath "com.android.tools.build:gradle:3.4.2" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'net.wequick.tools.build:gradle-small:1.2.0-beta3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }

configurations.all {
    resolutionStrategy {
        force "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
        force "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

} 这个搞定了

newcman avatar May 28 '21 06:05 newcman