[TIMOB-28270] Android: App builds fail if it includes the "jaxen" library
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Unresolved |
Affected Version/s | Release 9.0.0 |
Fix Version/s | Release 10.0.0 |
Components | Android |
Labels | android, build, gradle, library |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2020-12-03T19:39:24.000+0000 |
Updated | 2020-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:*
Add the below "build.gradle" to project folder:
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'
}
}
FR Passed, waiting on Jenkins build.
merged to master for 10.0.0 target