mapbox / mapbox-plugins-android

Mapbox Android Plugins are a collection of libraries that extend our other SDKs, helping you design powerful mapping features while the plugins handle most of the heavy lifting.
https://www.mapbox.com/android-docs/plugins/overview/
BSD 2-Clause "Simplified" License
241 stars 120 forks source link

Jetifier fails on Mapbox aars when attempting to migrate to AndroidX #1060

Open clydebarrow opened 5 years ago

clydebarrow commented 5 years ago

Steps to reproduce

  1. Migrate existing working project to AndroidX
  2. Build via gradle from command line.

Expected behavior

Successful build

Actual behavior

Errors thrown for each Mapbox aar as below. No errors on any other libraries.

> Could not resolve all files for configuration ':androidLib:debugCompileClasspath'.
   > Failed to transform artifact 'mapbox-android-plugin-annotation-v8.aar (com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v8:0.7.0)' to match attributes {artifactType=android-aidl}.
      > Execution failed for JetifyTransform: /Users/clyde/.gradle/caches/modules-2/files-2.1/com.mapbox.mapboxsdk/mapbox-android-plugin-annotation-v8/0.7.0/ad94f8386bc00f894c1c030b1188aec571e74533/mapbox-android-plugin-annotation-v8-0.7.0.aar.
         > Failed to transform '/Users/clyde/.gradle/caches/modules-2/files-2.1/com.mapbox.mapboxsdk/mapbox-android-plugin-annotation-v8/0.7.0/ad94f8386bc00f894c1c030b1188aec571e74533/mapbox-android-plugin-annotation-v8-0.7.0.aar' using Jetifier. Reason: null. (Run with --stacktrace for more details.)
   > Failed to transform artifact 'mapbox-android-plugin-building-v8.aar (com.mapbox.mapboxsdk:mapbox-android-plugin-building-v8:0.6.0)' to match attributes {artifactType=android-aidl}.
      > Execution failed for JetifyTransform: /Users/clyde/.gradle/caches/modules-2/files-2.1/com.mapbox.mapboxsdk/mapbox-android-plugin-building-v8/0.6.0/6c38df387e04b809466779f2299427fa78d0ac2c/mapbox-android-plugin-building-v8-0.6.0.aar.
         > Failed to transform '/Users/clyde/.gradle/caches/modules-2/files-2.1/com.mapbox.mapboxsdk/mapbox-android-plugin-building-v8/0.6.0/6c38df387e04b809466779f2299427fa78d0ac2c/mapbox-android-plugin-building-v8-0.6.0.aar' using Jetifier. Reason: null. (Run with --stacktrace for more details.)

The stacktrace is not particularly informative:

Caused by: java.lang.IllegalArgumentException
        at org.objectweb.asm.ClassVisitor.<init>(ClassVisitor.java:79)
        at org.objectweb.asm.commons.ClassRemapper.<init>(ClassRemapper.java:61)
        at org.objectweb.asm.commons.ClassRemapper.<init>(ClassRemapper.java:56)
        at com.android.tools.build.jetifier.processor.transform.bytecode.CoreRemapperImpl.<init>(CoreRemapperImpl.kt:57)
        at com.android.tools.build.jetifier.processor.transform.bytecode.ByteCodeTransformer.runTransform(ByteCodeTransformer.kt:38)
        at com.android.tools.build.jetifier.processor.Processor.visit(Processor.kt:443)
        at com.android.tools.build.jetifier.processor.archive.ArchiveFile.accept(ArchiveFile.kt:49)
        at com.android.tools.build.jetifier.processor.Processor.visit(Processor.kt:425)
        at com.android.tools.build.jetifier.processor.archive.Archive.accept(Archive.kt:76)
        at com.android.tools.build.jetifier.processor.Processor.visit(Processor.kt:425)
        at com.android.tools.build.jetifier.processor.archive.Archive.accept(Archive.kt:76)
        at com.android.tools.build.jetifier.processor.Processor.transformLibrary(Processor.kt:421)
        at com.android.tools.build.jetifier.processor.Processor.transform(Processor.kt:247)
        at com.android.build.gradle.internal.dependency.JetifyTransform.transform(JetifyTransform.kt:113)

Configuration

Mapbox SDK versions: Android 8.4.0

clydebarrow commented 5 years ago

I have tried removing the gradle cache, with no change.

stale[bot] commented 4 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] commented 4 years ago

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.