You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 19, 2020. It is now read-only.
I have an android project where I have a separate dependencies.gradle file.
I've just shifted that to dependencies.gradle.kts. Now Gradle don't recognize any implementation configuration anymore :/
Expected Behavior
I want that the dependencies.gradle.kts works like the dependencies.gradle before.
Current Behavior
If I try to run it prints:
Script compilation errors:
Line 2: implementation("com.android.support:appcompat-v7:27.1.1")
^ Unresolved reference: implementation
Line 3: implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.30")
^ Unresolved reference: implementation
Line 4: implementation("org.jetbrains.kotlin:kotlin-reflect:1.2.30")
^ Unresolved reference: implementation
Line 5: testImplementation("junit:junit:4.12")
^ Unresolved reference: testImplementation
Line 6: androidTestImplementation("com.android.support.test:runner:1.0.1")
^ Unresolved reference: androidTestImplementation
Line 7: androidTestImplementation("com.android.support.test.espresso:espresso-core:3.0.1")
^ Unresolved reference: androidTestImplementation
Context
Don't know if the "interop" between *kts and groovy is broken or something different ...
Maybe related to #803 ?
This is expected. The Gradle Kotlin DSL can't know at script compilation time that these configurations will be available when the script is applied, it could be applied by any other script. Hence the Kotlin extensions for these configuration not being available at script compilation time. You have to reference the configurations by name at runtime.
// dependencies.gradle.ktsval implementation by configurations
val testImplementation by configurations
val androidTestImplementation by configurations
dependencies {
implementation("com.android.support:appcompat-v7:27.1.1")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.30")
implementation("org.jetbrains.kotlin:kotlin-reflect:1.2.30")
testImplementation("junit:junit:4.12")
androidTestImplementation("com.android.support.test:runner:1.0.1")
androidTestImplementation("com.android.support.test.espresso:espresso-core:3.0.1")
}
I have an android project where I have a separate
dependencies.gradle
file.I've just shifted that to
dependencies.gradle.kts
. Now Gradle don't recognize anyimplementation
configuration anymore :/Expected Behavior
I want that the
dependencies.gradle.kts
works like thedependencies.gradle
before.Current Behavior
If I try to run it prints:
Context
Don't know if the "interop" between *kts and groovy is broken or something different ...
Maybe related to #803 ?
Steps to Reproduce (for bugs)
This is my code:
build.gradle
dependencies.gradle.kts
Your Environment
Gradle: 4.7
The text was updated successfully, but these errors were encountered: