Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28270] Android: App builds fail if it includes the "jaxen" library

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionUnresolved
Affected Version/sRelease 9.0.0
Fix Version/sRelease 10.0.0
ComponentsAndroid
Labelsandroid, build, gradle, library
ReporterJoshua Quick
AssigneeJoshua Quick
Created2020-12-03T19:39:24.000+0000
Updated2020-12-15T15:44:25.000+0000

Description

*Summary:* If an app includes the "jaxen" Java library via gradle (or a module that references it via gradle), then it will fail to build. *Steps to reproduce:*

Create a "Classic" Titanium app project.

Add the below "build.gradle" to project folder: ./platform/android

Build for Android.

./platform/android/build.gradle
dependencies {
	implementation 'jaxen:jaxen:1.2.0'
}
*Result:* The following build failure will occur...
[ERROR] [GRADLE] Execution failed for task ':app:checkDebugDuplicateClasses'.
[ERROR] [GRADLE] > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
[ERROR] [GRADLE]    > Duplicate class org.jaxen.BaseXPath found in modules jetified-jaxen-1.2.0 (jaxen:jaxen:1.2.0) and jetified-titanium-10.0.0-runtime (org.appcelerator:titanium:10.0.0)
[ERROR] [GRADLE]      Duplicate class org.jaxen.Context found in modules jetified-jaxen-1.2.0 (jaxen:jaxen:1.2.0) and jetified-titanium-10.0.0-runtime (org.appcelerator:titanium:10.0.0)
[ERROR] [GRADLE]      Duplicate class org.jaxen.ContextSupport found in modules jetified-jaxen-1.2.0 (jaxen:jaxen:1.2.0) and jetified-titanium-10.0.0-runtime (org.appcelerator:titanium:10.0.0)
*Cause:* Titanium builds with a local "jaxen-1.1.1.jar" below. It's used by our Ti.XML APIs. https://github.com/appcelerator/titanium_mobile/tree/master/android/modules/xml/lib *Work-Around:* Add the following "build.gradle" to the app project's ./platform/android folder. It will exclude jaxen library references from the gradle build to avoid collision with Titanium's local JAR. Although, once we fix this issue, you'll need to remove the below.
configurations {
	all {
		exclude group: 'jaxen', module: 'jaxen'
	}
}

Comments

  1. Samir Mohammed 2020-12-15

    FR Passed, waiting on Jenkins build.
  2. Christopher Williams 2020-12-15

    merged to master for 10.0.0 target

JSON Source