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

No upload tasks showing after moving to build.gradle.kts #32

Open
kingargyle opened this issue Oct 30, 2019 · 5 comments
Open

No upload tasks showing after moving to build.gradle.kts #32

kingargyle opened this issue Oct 30, 2019 · 5 comments
Labels
bug Something isn't working

Comments

@kingargyle
Copy link

After moving our builds to the Kotlin-DSL, the upload task is no longer being registered for the various build flavors.

The kotlin-dsl picks up the appcenter -> apps extensions, but I must use either a create("flavorName") or getByName("flavorName") to get the rest of the extensions configuration.

basically when I now run the: gradlew tasks

I get no entries for the appcenter plugin, where I did before the migration.

@oliviergauthier oliviergauthier added the bug Something isn't working label Nov 8, 2019
@es0329
Copy link

es0329 commented Feb 21, 2020

@oliviergauthier I'm also facing this same bug.

@kingargyle did you ever find a workaround?

@kingargyle
Copy link
Author

@es0329 I extracted the DSL into it's own .gradle file, and include it as part of the scripts that need to use it.

@es0329
Copy link

es0329 commented Feb 25, 2020

@kingargyle I also tried that to no avail. You give me hope though! I'll revisit when I'm able and share the specific error message.

@es0329
Copy link

es0329 commented Feb 28, 2020

Alright so... with the Kotlin DSL the project builds but without tasks registered/found for this plugin.

When I extract the config to a .gradle file and use apply { from(...) } in my .gradle.kts file, then the project fails to build.

ERROR: Unable to find method 'com.android.build.gradle.tasks.PackageAndroidArtifact.getOutputDirectory()Lorg/gradle/api/file/DirectoryProperty;'.
Possible causes for this unexpected error include:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)

The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)

Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

I tried those suggestions, but no go. Commenting/uncommenting that apply line toggles whether it hits that error while building.

@kingargyle
Copy link
Author

I did eventually, move the source code to build locally as part of the buildSrc directory, but in general I kept the configuration as a standard gradle option.

In the build.gradle.kts script that builds the source I do have a specified dependency on the android gradle tools.

implementation("com.android.tools.build:gradle:3.5.3")

Might need to make sure the depedency is on the class path when the build runs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants