Skip to content
This repository has been archived by the owner on Feb 5, 2022. It is now read-only.

Dependency not in the configuration but used in the bytecode is not reported #13

Open
fondesa opened this issue Aug 3, 2020 · 1 comment

Comments

@fondesa
Copy link

fondesa commented Aug 3, 2020

AndroidX Jetifier replaces the usages in the bytecode of support libraries with AndroidX ones. This means that if a dependency doesn't declare any support libs dependency but uses it in the bytecode, Jetifier would replace those usages but can-i-drop-jetifier would not.

For example, the Cardinal Commerce SDK used by the Braintree Drop-In SDK, have this POM:

<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.jfrog.cardinalcommerce.gradle</groupId>
  <artifactId>cardinalmobilesdk</artifactId>
  <version>2.2.3-2</version>
  <packaging>aar</packaging>
</project>

As you can see, the POM doesn't contain any dependency, but the Cardinal Commerce SDK are using internally some Android support classes if you look at their bytecode.

This results in Jetifier correcting replacing those usages when it's enabled, but in a misleading report of can-i-drop-jetifier.

It would be useful to align can-i-drop-jetifier to how the Android Jetifier works, so looking directly into the bytecode.

@kakai248
Copy link

Yep. Having the same issue. Plugin says nothing uses support libraries but as soon as I disable jetifier, apps crashes with class not found.

But I can't figure what is using support libraries.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants