I\'m using Android Studio 3.2 Canary 14 and am trying to migrate an existing project to use AndroidX
. It sounds from https://developer.android.com/topic/libraries/s
As per a statement on the AndroidX refactor made by a Google Engineer (Support Library) during the I/O session "What's New in Support Library?", Google already discovered bugs related to Jetifier in Android Studio 3.2 Canary 14.
Thus, it is advised to wait until Canary 15 (to be released the coming week) before starting the AndroidX migration process.
For those experiencing the same issue with Android Studio 3.2 Canary 15 (or later) after using "Refactor to AndroidX...":
I had to update some dependencies manually, i.e. change
classpath 'io.fabric.tools:gradle:1.25.1'
to
classpath 'io.fabric.tools:gradle:1.27.0'
in my project's build.gradle file.
If you're using dagger you have to upgrade to version 2.20 or later.
This is because some libraries are not yet compatible with the AndroidX refactor as mentioned under Known issues in the AndroidX release notes.
I had this same error after adding JDK 11 to my machine. It set itself as default JDK and this error started happening.
After setting JDK 8 as default, it was fixed.
I was able to work around a similar problem by excluding a certain library from being jetified, which can be done by adding to gradle.properties:
android.jetifier.blacklist = ...
Note that this option was added in Android Gradle plugin 3.3.0-rc01 as a temporary workaround. See https://issuetracker.google.com/issues/119135578#comment5 for more details.
I had been experiencing this problem while running assembleAndroidTest on Jenkins. The weirdest part was that this task ran sans any issues on my mac's terminal without any issues, but failed on Jenkins with-
Failed to transform file 'cucumber-java-1.2.5.jar' to match attributes {artifactType=processed-jar} using transform JetifyTransform
Had been looking for solutions for a couple of days now, having worked though different suggestions - none of which worked.
Finally, disabling Jetifier in gradle.properties resolved it for me.
android.enableJetifier=false