Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't find Android extension #115

Open
dalewking opened this issue May 31, 2022 · 4 comments
Open

Doesn't find Android extension #115

dalewking opened this issue May 31, 2022 · 4 comments
Labels

Comments

@dalewking
Copy link

Describe the bug
Applying the plugin to an Android project fails with:

Android extension not found. Make sure the Android plugin is applied

I am using AGP 7.0.3 and Gradle 7.2 and 1.8.2 of Gordon (because it is closest to those versions, but it fails for 1.8.0 and 1.8.5 as well.

@dalewking dalewking added the bug label May 31, 2022
@joshschriever
Copy link
Collaborator

The only thing I can think off hand is the order you apply plugins - make sure the Android plugin is applied before the Gordon plugin in your buildscript. If that's already the case, I'm not sure what would be causing this. If you paste your whole buildscript, I might be able to help debug. You could also try running the Gordon Gradle task with --stacktrace to see exactly where that error is coming from.

@dalewking
Copy link
Author

So I discovered that error message I reported is actually coming from another plugin, but due to this plugin not applying. The relevant part of the stack trace is:

Caused by: java.lang.IllegalStateException: Gordon plugin must be applied after applying the application, library, or dynamic-feature Android plugin
        at com.banno.gordon.GordonPlugin.apply(GordonPlugin.kt:27)
        at com.banno.gordon.GordonPlugin.apply(GordonPlugin.kt:23)

But my plugins block looks like this:

plugins {
    id("com.android.application")
    kotlin("android")
// other plugins
     id("com.banno.gordon")
}

@joshschriever
Copy link
Collaborator

That's odd. Does the same thing happen if you apply Gordon directly after the Android plugin, before the others?

@dalewking
Copy link
Author

So I have determined that if I include gordon using buildscript.dependencies.classpath entry in my top level build.gradle.kts file, then it works. If I try to instead specify the version in a pluginManagement.plugins entry in my settings.gradle.kts file then that is when it doesn't work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants