question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: Can't Build the Project

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

What happened?

I can’t build the project. I’m on Android Studio Electric Eel, Gradle 7.4, Using Java 11. The build keeps failing with the following output

Relevant logcat output

> Task :build-logic:convention:compileKotlin
e: /Users/isaac/AndroidStudioProjects/nowinandroid/build-logic/convention/src/main/kotlin/nowinandroid.android.application.compose.gradle.kts: (23, 1): Expression 'android' cannot be invoked as a function. The function 'invoke()' is not found
e: /Users/isaac/AndroidStudioProjects/nowinandroid/build-logic/convention/src/main/kotlin/nowinandroid.android.application.compose.gradle.kts: (23, 1): Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: 
internal val ComPluginGroup.android: ComAndroidPluginGroup defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
internal val OrgJetbrainsKotlinPlatformPluginGroup.android: PluginDependencySpec defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
internal val OrgJetbrainsKotlinPluginGroup.android: PluginDependencySpec defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
internal val PluginDependenciesSpec.android: PluginDependencySpec defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
e: /Users/isaac/AndroidStudioProjects/nowinandroid/build-logic/convention/src/main/kotlin/nowinandroid.android.application.compose.gradle.kts: (24, 29): Type mismatch: inferred type is Nowinandroid_android_application_compose_gradle but CommonExtension<*, *, *, *> was expected
e: /Users/isaac/AndroidStudioProjects/nowinandroid/build-logic/convention/src/main/kotlin/nowinandroid.android.application.gradle.kts: (24, 1): Expression 'android' cannot be invoked as a function. The function 'invoke()' is not found
e: /Users/isaac/AndroidStudioProjects/nowinandroid/build-logic/convention/src/main/kotlin/nowinandroid.android.application.gradle.kts: (24, 1): Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: 
internal val ComPluginGroup.android: ComAndroidPluginGroup defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
internal val OrgJetbrainsKotlinPlatformPluginGroup.android: PluginDependencySpec defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
internal val OrgJetbrainsKotlinPluginGroup.android: PluginDependencySpec defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
internal val PluginDependenciesSpec.android: PluginDependencySpec defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
e: /Users/isaac/AndroidStudioProjects/nowinandroid/build-logic/convention/src/main/kotlin/nowinandroid.android.application.gradle.kts: (25, 28): Type mismatch: inferred type is Nowinandroid_android_application_gradle but CommonExtension<*, *, *, *> was expected
e: /Users/isaac/AndroidStudioProjects/nowinandroid/build-logic/convention/src/main/kotlin/nowinandroid.android.application.gradle.kts: (27, 5): Unresolved reference: defaultConfig
e: /Users/isaac/AndroidStudioProjects/nowinandroid/build-logic/convention/src/main/kotlin/nowinandroid.android.application.gradle.kts: (28, 9): Unresolved reference: targetSdk
e: /Users/isaac/AndroidStudioProjects/nowinandroid/build-logic/convention/src/main/kotlin/nowinandroid.android.application.jacoco.gradle.kts: (24, 1): Expression 'android' cannot be invoked as a function. The function 'invoke()' is not found
e: /Users/isaac/AndroidStudioProjects/nowinandroid/build-logic/convention/src/main/kotlin/nowinandroid.android.application.jacoco.gradle.kts: (24, 1): Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: 
internal val ComPluginGroup.android: ComAndroidPluginGroup defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
internal val OrgJetbrainsKotlinPlatformPluginGroup.android: PluginDependencySpec defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
internal val OrgJetbrainsKotlinPluginGroup.android: PluginDependencySpec defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
internal val PluginDependenciesSpec.android: PluginDependencySpec defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
e: /Users/isaac/AndroidStudioProjects/nowinandroid/build-logic/convention/src/main/kotlin/nowinandroid.android.application.jacoco.gradle.kts: (25, 5): Unresolved reference: androidComponents
e: /Users/isaac/AndroidStudioProjects/nowinandroid/build-logic/convention/src/main/kotlin/nowinandroid.android.application.jacoco.gradle.kts: (26, 25): Type mismatch: inferred type is Nowinandroid_android_application_jacoco_gradle but AndroidComponentsExtension<*, *, *> was expected
e: /Users/isaac/AndroidStudioProjects/nowinandroid/build-logic/convention/src/main/kotlin/nowinandroid.android.library.compose.gradle.kts: (23, 1): Expression 'android' cannot be invoked as a function. The function 'invoke()' is not found
e: /Users/isaac/AndroidStudioProjects/nowinandroid/build-logic/convention/src/main/kotlin/nowinandroid.android.library.compose.gradle.kts: (23, 1): Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: 
internal val ComPluginGroup.android: ComAndroidPluginGroup defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
internal val OrgJetbrainsKotlinPlatformPluginGroup.android: PluginDependencySpec defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
internal val OrgJetbrainsKotlinPluginGroup.android: PluginDependencySpec defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt
internal val PluginDependenciesSpec.android: PluginDependencySpec defined in gradle.kotlin.dsl.plugins._575eff10af4d8ac420c2c0a93a3cb44b in file PluginSpecBuilders.kt

Code of Conduct

  • I agree to follow this project’s Code of Conduct

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:16
  • Comments:37 (12 by maintainers)

github_iconTop GitHub Comments

8reactions
ductam1987commented, May 13, 2022

@Zikstar , I got the same problem & fixed it by upgrading the GradlePlugin from 7.1.2 to 7.1.3

5reactions
agent10commented, May 13, 2022

Weird, what just helped me is to add an empty line to root build.gradle.kts

Read more comments on GitHub >

github_iconTop Results From Across the Web

[bug] Can't build project · Issue #3690 · tauri-apps/tauri - GitHub
Describe the bug​​ I can't build my tauri project. I used the tauri-vite template, but switched the vue-project with vitesse template from antfu....
Read more >
Bug - Can't build for Android - Unity Forum
I guess making an empty project and building for android is not one of the tests they do before they release their latest...
Read more >
I can't build :: Project Zomboid Bug Tracker - Steam Community
I can build window barricade or wooden floor but can't door or wall. I tried to delete the game.
Read more >
Can't build solution when using Folder View
The Visual Studio team has determined that this issue is not a bug. Switching to the folder view activates folder-specific build commands.
Read more >
Xcode can't build a project | Apple Developer Forums
Hello,. project works fine in Xcode 12.5.1, but when I open it in 13.1 to test, I get error when hitting build. First...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found