Capacitor: bug: Android Build gradle 4.0.0

Created on 28 May 2020  ·  4Comments  ·  Source: ionic-team/capacitor

Bug Report

Capacitor Version

npx cap doctor output:
Latest Dependencies:

@capacitor/cli: 2.1.1

@capacitor/core: 2.1.1

@capacitor/android: 2.1.1

@capacitor/electron: 2.1.1

@capacitor/ios: 2.1.1

Installed Dependencies:

@capacitor/electron not installed

@capacitor/cli 2.1.1

@capacitor/android 2.1.1

@capacitor/ios 2.1.1

@capacitor/core 2.1.1

[success] Android looking great! 👌
Found 2 Capacitor plugins for ios:
@codetrix-studio/capacitor-google-auth (2.1.1)
capacitor-apple-login (0.0.6)
[success] iOS looking great! 👌

Affected Platform(s)

  • [x] Android
  • [ ] iOS
  • [ ] Electron
  • [ ] Web

Current Behavior


My Android build gradle crash after upgrade from 3.6.3 to 4.0.0

Android studio autoupdate to v4.0
before :
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
after :
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

im getting this error in Android studio console

Cause: org/gradle/api/internal/java/usagecontext/LazyConfigurationUsageContext

Expected Behavior

Sample Code or Sample Application Repo

Reproduction Steps

Other Technical Details

npm --version output:
6.14.4
node --version output:
v12.16.0
pod --version output (iOS issues only):

Other Information

Stack similar error
https://stackoverflow.com/questions/61066014/ionic-capacitor-app-give-me-lots-of-errors

Most helpful comment

:wave: This issue is fixed in Capacitor 2.1.2. Please let us know if you have any further issues! Thanks!

All 4 comments

This is happening after the last Android Studio update to 4.0. You are prompted to update to the new stable version of the plugin and if you accept it will put it on version 4.0.0. This version has a minimum requirement of Gradle version 6.0.0.
You can temporarily fix the issue by downgrading both versions Gradle and Gradle plugin in File -> Project Structure -> Project.

From #3009

There is a known issue with the bintray-release Gradle plugin used in the capacitor-android Gradle file included in Android apps

novoda/bintray-release#298

For now, the workaround is don't update the Android build tools and Gradle plugin after upgrading to Android Studio 4.0.

Also, bintray-release isn't really needed for app developers. Can this be removed from the capacitor-app build.gradle and added but commented out in one android-template build.gradle files? It's not needed for app developers. Plugin developers could then uncomment it as needed.

:wave: This issue is fixed in Capacitor 2.1.2. Please let us know if you have any further issues! Thanks!

👋 This issue is fixed in Capacitor 2.1.2. Please let us know if you have any further issues! Thanks!

Fixed. Thank you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ebk46 picture ebk46  ·  3Comments

gnesher picture gnesher  ·  3Comments

mlynch picture mlynch  ·  3Comments

Hansel03 picture Hansel03  ·  3Comments

danielsogl picture danielsogl  ·  3Comments