Skip to content

Build fails with Android Gradle Plugin 4.1.0 #800

@barbeau

Description

@barbeau

Summary

After updating from classpath 'com.android.tools.build:gradle:4.0.2' to classpath 'com.android.tools.build:gradle:4.1.0', the demo app will no longer build and I get the error:

> Extension not initialized yet, couldn't access compileSdkVersion.

If I change back to classpath 'com.android.tools.build:gradle:4.0.2' it builds and runs without any problems.

Here's a branch showing the issue:

https://github.com/googlemaps/android-maps-utils/tree/sean/gradle-4.1.0

I believe this is an issue with Android Gradle Plugin 4.1.0, so I've opened an issue on the Google IssueTracker here:
https://issuetracker.google.com/issues/172273529

Expected behavior

Demo app should build (and from within Android Studio, the demo app should launch)

Observed behavior

Executing tasks: [:demo:assembleDebug] in project C:\android-projects\android-maps-utils

Starting Gradle Daemon...
Gradle Daemon started in 2 s 668 ms
Configuration on demand is an incubating feature.

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':demo:compileDebugJavaWithJavac'.
> Extension not initialized yet, couldn't access compileSdkVersion.

Steps to reproduce

  1. Clone/checkout https://github.com/googlemaps/android-maps-utils/tree/sean/gradle-4.1.0
  2. Run the demo app from within Android Studio, or run ./gradlew :demo:assembleDebug from the command line

Environment details

See branch https://github.com/googlemaps/android-maps-utils/tree/sean/gradle-4.1.0 for code.

Build: AI-201.8743.12.41.6858069, 202009231536,

AI-201.8743.12.41.6858069, JRE 1.8.0_242-release-1644-b01x64 JetBrains s.r.o, OS Windows 10(amd64) v10.0 , screens 1536x960, 1707x960, 1536x864

AS: 4.1; Kotlin plugin: 1.4.10-release-Studio4.1-1; Android Gradle Plugin: 4.1.0; Gradle: 6.5; NDK: from local.properties: (not specified), latest from SDK: (not found); LLDB: pinned revision 3.1 not found, latest from SDK: (package not found); CMake: from local.properties: (not specified), latest from SDK: (not found), from PATH: (not found)

Metadata

Metadata

Assignees

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.releasedtype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions