Skip to content

Gradle build error due to Android support lib 27.1.0 usage / Program type already present #1158

@lambourn

Description

@lambourn

CLI version: 4.2.1
Android runtime version: 4.2.0
minSdkVersion: 21
targetSdkVersion: 26

Not sure if this is a bug, but after upgrading to {N} 4.2 our release build for Android fails during Gradle's :app:transformDexArchiveWithExternalLibsDexMergerForRelease task.

Error:

D8: Program type already present: android.support.design.widget.CoordinatorLayout$Behavior

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForRelease'.

It turned out that the Android support lib version used in the generated platforms/android/app/build.gradle is causing this.

Workaround was to add this to the App_Resources/Android/app.gradle file

ext {
    supportVersion = "27.1.0"
}

then compilation works fine.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions