Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-28270

Android: App builds fail if it includes the "jaxen" library

    Details

    • Story Points:
      3
    • Sprint:
      2020 Sprint 25

      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:

      1. Create a "Classic" Titanium app project.
      2. Add the below "build.gradle" to project folder: ./platform/android
      3. 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'
      	}
      }
      

        Attachments

          Activity

            People

            • Assignee:
              jquick Joshua Quick
              Reporter:
              jquick Joshua Quick
              Reviewer:
              Gary Mathews
              Tester:
              Samir Mohammed
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration