9

Everything used to work fine until today. Didn't change anything as far as I know and now I get this:

C:\mypath>gradle appengineDeploy

> Configure project :
WARNING: You are a using release candidate 2.0.0-rc1. Behavior of this plugin has changed since 1.3.5. Please see release notes at: https://github.com/GoogleCloudPlatform/app-gradle-plugin.
Missing a feature? Can't get it to work?, please file a bug at: https://github.com/GoogleCloudPlatform/app-gradle-plugin/issues.

> Task :appengineDeploy FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':appengineDeploy'.
> Deployment version must be defined or configured to read from system state
  1. Set appengine.deploy.version = 'my-version'
  2. Set appengine.deploy.version = 'GCLOUD_CONFIG' to have gcloud generate a version for you.
  3. Using APPENGINE_CONFIG is not allowed for flexible environment projects

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.8.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 6s
8 actionable tasks: 6 executed, 2 up-to-date

I just updated gradle from version 4.5.1 to 4.8.1 but the same issue remains. I understand it complains about version of the appengine but I never had to state that before so I think it's due to some update on Google's side. What am I missing?

djokerndthief
  • 455
  • 2
  • 4
  • 16

2 Answers2

13

You are now using the app-gradle-plugin version 2.0.0-rc1 as I can see from your console output, which was released 2 days ago. It has some changes, which the developers of the plugin documented.

As you can see in the Change Log of this release candidate from google, it mentions in the changes:

project and version are no longer pulled from the global gcloud state by default. project must be configured in build.gradle using the deploy.project property, users may use special keywords for project to specify that they would like to read it from appengine-web.xml (project = "APPENGINE_CONFIG") or from gcloud global state (project = "GCLOUD_CONFIG"). version is also configured the same way.

So you just have to specify in your gradle.build the following:

appengine {
    deploy {
        version = "GCLOUD_CONFIG"
        project = "GCLOUD_CONFIG"
    }
}

Update in 2.0.0-rc3 (Thanks to @wildcat12 for pointing it out) in the latest version 2.0.0-rc3, the project configuration property has changed.

Changed appengine.deploy.project -> appengine.deploy.projectId

Therefore, now your gradle.build configuration would look like that:

appengine {
    deploy {
        version = "GCLOUD_CONFIG"
        projectId = "GCLOUD_CONFIG"
    }
}
Hesham Massoud
  • 1,550
  • 1
  • 11
  • 17
  • It seems to be working fine after I did this. Thank you so much! I had tried doing half of that (version = "GCLOUD_CONFIG") but I think I missed the "" and project one. Sloppy. Again, thank you! – djokerndthief Jun 29 '18 at 02:48
  • @djokerndthief glad it works for you! Please don’t forget to mark the answer as the correct one ;) – Hesham Massoud Jun 29 '18 at 07:10
  • I did now, but it wont show until I get better reputation. Thanks. – djokerndthief Jul 01 '18 at 13:29
  • With the latest version, it has to be "projectId" (rather than "project") or you'll get an error. https://github.com/GoogleCloudPlatform/app-gradle-plugin/blob/master/USER_GUIDE.md – wildcat12 Oct 26 '18 at 15:32
0

If you are using

classpath 'com.google.cloud.tools:appengine-gradle-plugin:+'

line in your build.gradle file you are using the 2.0.0-rc3 release candidate version now. It is working well with last stable version: 1.3.5.