can-i-drop-jetifier icon indicating copy to clipboard operation
can-i-drop-jetifier copied to clipboard

Does not work with some libraries

Open lepicekmichal opened this issue 6 years ago • 5 comments

com.instabug.library:instabug com.facebook.android:facebook-android-sdk

lepicekmichal avatar Feb 25 '19 16:02 lepicekmichal

Hi, thanks for reporting the issue! Could you please give some more details, does the analysis give wrong results for those libraries or an error/exception occurs?

plnice avatar Feb 25 '19 20:02 plnice

It's a multimodule project and when I run the plugin with parameter to disable jetifier (or disable it in gradle.properties) I get output saying "You can turn off jetifier" for all modules, but when I do, it cannot be built.

I traversed output of gradlew dependencies and found at least these two above depending on support libraries.

lepicekmichal avatar Feb 25 '19 20:02 lepicekmichal

Hi, both libraries are correctly reported when I add them to sample module in this repository:

Miloszs-MacBook-Pro:can-i-drop-jetifier miloszlewandowski$ git diff
diff --git a/sample/build.gradle.kts b/sample/build.gradle.kts
index 1eaff34..397209e 100644
--- a/sample/build.gradle.kts
+++ b/sample/build.gradle.kts
@@ -37,6 +37,8 @@ dependencies {
     // Example obsolete dependencies
     implementation("com.squareup.leakcanary:leakcanary-android:1.6.3")
     implementation("com.android.support:cardview-v7:28.0.0")
+    implementation("com.instabug.library:instabug:8.0.19")
+    implementation("com.facebook.android:facebook-android-sdk:4.40.0")
 }

 canIDropJetifier {
Miloszs-MacBook-Pro:can-i-drop-jetifier miloszlewandowski$ ./gradlew -Pandroid.enableJetifier=false canIDropJetifier

> Configure project :canidropjetifier
WARNING: Unsupported Kotlin plugin version.
The `embedded-kotlin` and `kotlin-dsl` plugins rely on features of Kotlin `1.3.11` that might work differently than in the requested version `1.3.20`.
========================================
Project sample
========================================

Cannot drop Jetifier due to following dependencies:

* com.android.support:cardview-v7:28.0.0

* com.squareup.leakcanary:leakcanary-android:1.6.3
  \-- com.android.support:support-core-utils:28.0.0
  \-- com.squareup.leakcanary:leakcanary-analyzer:1.6.3
   \-- com.android.support:support-annotations:28.0.0

* com.instabug.library:instabug:8.0.19
  \-- com.instabug.library:instabug-survey:8.0.19
   \-- com.instabug.library:instabug-core:8.0.19
    \-- com.android.support:design:28.0.0
  \-- com.instabug.library:instabug-survey:8.0.19
   \-- com.instabug.library:instabug-core:8.0.19
    \-- com.android.support:support-v4:28.0.0
  \-- com.instabug.library:instabug-crash:8.0.19
   \-- com.instabug.library:instabug-core:8.0.19
    \-- com.android.support:design:28.0.0
  \-- com.instabug.library:instabug-crash:8.0.19
   \-- com.instabug.library:instabug-core:8.0.19
    \-- com.android.support:support-v4:28.0.0
  \-- com.instabug.library:instabug-bug:8.0.19
   \-- com.instabug.library:instabug-core:8.0.19
    \-- com.android.support:design:28.0.0
  \-- com.instabug.library:instabug-bug:8.0.19
   \-- com.instabug.library:instabug-core:8.0.19
    \-- com.android.support:support-v4:28.0.0
  \-- com.instabug.library:instabug-chat:8.0.19
   \-- com.instabug.library:instabug-core:8.0.19
    \-- com.android.support:design:28.0.0
  \-- com.instabug.library:instabug-chat:8.0.19
   \-- com.instabug.library:instabug-core:8.0.19
    \-- com.android.support:support-v4:28.0.0
  \-- com.instabug.library:instabug-features-request:8.0.19
   \-- com.instabug.library:instabug-core:8.0.19
    \-- com.android.support:design:28.0.0
  \-- com.instabug.library:instabug-features-request:8.0.19
   \-- com.instabug.library:instabug-core:8.0.19
    \-- com.android.support:support-v4:28.0.0
  \-- com.instabug.library:instabug-bug:8.0.19
   \-- com.instabug.library:instabug-chat:8.0.19
    \-- com.instabug.library:instabug-core:8.0.19
     \-- com.android.support:design:28.0.0
  \-- com.instabug.library:instabug-bug:8.0.19
   \-- com.instabug.library:instabug-chat:8.0.19
    \-- com.instabug.library:instabug-core:8.0.19
     \-- com.android.support:support-v4:28.0.0

* com.facebook.android:facebook-android-sdk:4.40.0
  \-- com.facebook.android:facebook-login:4.40.0
   \-- com.android.support:appcompat-v7:28.0.0
  \-- com.facebook.android:facebook-common:4.40.0
   \-- com.android.support:cardview-v7:28.0.0
  \-- com.facebook.android:facebook-common:4.40.0
   \-- com.android.support:support-v4:28.0.0
  \-- com.facebook.android:facebook-common:4.40.0
   \-- com.android.support:appcompat-v7:28.0.0
  \-- com.facebook.android:facebook-common:4.40.0
   \-- com.android.support:customtabs:27.0.2
  \-- com.facebook.android:facebook-marketing:4.40.0
   \-- com.android.support:support-annotations:28.0.0
  \-- com.facebook.android:facebook-core:4.40.0
   \-- com.android.support:support-core-utils:28.0.0
  \-- com.facebook.android:facebook-core:4.40.0
   \-- com.android.support:support-annotations:28.0.0
  \-- com.facebook.android:facebook-login:4.40.0
   \-- com.facebook.android:facebook-common:4.40.0
    \-- com.android.support:cardview-v7:28.0.0
  \-- com.facebook.android:facebook-login:4.40.0
   \-- com.facebook.android:facebook-common:4.40.0
    \-- com.android.support:support-v4:28.0.0
  \-- com.facebook.android:facebook-login:4.40.0
   \-- com.facebook.android:facebook-common:4.40.0
    \-- com.android.support:appcompat-v7:28.0.0
  \-- com.facebook.android:facebook-login:4.40.0
   \-- com.facebook.android:facebook-common:4.40.0
    \-- com.android.support:customtabs:27.0.2
  \-- com.facebook.android:facebook-login:4.40.0
   \-- com.facebook.android:facebook-core:4.40.0
    \-- com.android.support:support-core-utils:28.0.0
  \-- com.facebook.android:facebook-login:4.40.0
   \-- com.facebook.android:facebook-core:4.40.0
    \-- com.android.support:support-annotations:28.0.0
  \-- com.facebook.android:facebook-share:4.40.0
   \-- com.facebook.android:facebook-common:4.40.0
    \-- com.android.support:cardview-v7:28.0.0
  \-- com.facebook.android:facebook-share:4.40.0
   \-- com.facebook.android:facebook-common:4.40.0
    \-- com.android.support:support-v4:28.0.0
  \-- com.facebook.android:facebook-share:4.40.0
   \-- com.facebook.android:facebook-common:4.40.0
    \-- com.android.support:appcompat-v7:28.0.0
  \-- com.facebook.android:facebook-share:4.40.0
   \-- com.facebook.android:facebook-common:4.40.0
    \-- com.android.support:customtabs:27.0.2
  \-- com.facebook.android:facebook-share:4.40.0
   \-- com.facebook.android:facebook-core:4.40.0
    \-- com.android.support:support-core-utils:28.0.0
  \-- com.facebook.android:facebook-share:4.40.0
   \-- com.facebook.android:facebook-core:4.40.0
    \-- com.android.support:support-annotations:28.0.0
  \-- com.facebook.android:facebook-common:4.40.0
   \-- com.facebook.android:facebook-core:4.40.0
    \-- com.android.support:support-core-utils:28.0.0
  \-- com.facebook.android:facebook-common:4.40.0
   \-- com.facebook.android:facebook-core:4.40.0
    \-- com.android.support:support-annotations:28.0.0
  \-- com.facebook.android:facebook-places:4.40.0
   \-- com.facebook.android:facebook-core:4.40.0
    \-- com.android.support:support-core-utils:28.0.0
  \-- com.facebook.android:facebook-places:4.40.0
   \-- com.facebook.android:facebook-core:4.40.0
    \-- com.android.support:support-annotations:28.0.0
  \-- com.facebook.android:facebook-applinks:4.40.0
   \-- com.facebook.android:facebook-core:4.40.0
    \-- com.android.support:support-core-utils:28.0.0
  \-- com.facebook.android:facebook-applinks:4.40.0
   \-- com.facebook.android:facebook-core:4.40.0
    \-- com.android.support:support-annotations:28.0.0
  \-- com.facebook.android:facebook-messenger:4.40.0
   \-- com.facebook.android:facebook-core:4.40.0
    \-- com.android.support:support-core-utils:28.0.0
  \-- com.facebook.android:facebook-messenger:4.40.0
   \-- com.facebook.android:facebook-core:4.40.0
    \-- com.android.support:support-annotations:28.0.0
  \-- com.facebook.android:facebook-marketing:4.40.0
   \-- com.facebook.android:facebook-core:4.40.0
    \-- com.android.support:support-core-utils:28.0.0
  \-- com.facebook.android:facebook-marketing:4.40.0
   \-- com.facebook.android:facebook-core:4.40.0
    \-- com.android.support:support-annotations:28.0.0
  \-- com.facebook.android:facebook-login:4.40.0
   \-- com.facebook.android:facebook-common:4.40.0
    \-- com.facebook.android:facebook-core:4.40.0
     \-- com.android.support:support-core-utils:28.0.0
  \-- com.facebook.android:facebook-login:4.40.0
   \-- com.facebook.android:facebook-common:4.40.0
    \-- com.facebook.android:facebook-core:4.40.0
     \-- com.android.support:support-annotations:28.0.0
  \-- com.facebook.android:facebook-share:4.40.0
   \-- com.facebook.android:facebook-common:4.40.0
    \-- com.facebook.android:facebook-core:4.40.0
     \-- com.android.support:support-core-utils:28.0.0
  \-- com.facebook.android:facebook-share:4.40.0
   \-- com.facebook.android:facebook-common:4.40.0
    \-- com.facebook.android:facebook-core:4.40.0
     \-- com.android.support:support-annotations:28.0.0

The issue can be related to the default options of the plugin. Could you please try following possible solutions:

  1. By default, only Android modules (modules that apply com.android.library or com.android.application plugin) are the subject of the analysis. Setting analyzeOnlyAndroidModules to false in plugin configuration will analyze all the modules in the project.
  2. By default, only some configurations are the subject of the analysis. Setting configurationRegex ".*" in plugin configuration should analyze all the configurations.

plnice avatar Feb 27 '19 07:02 plnice

Maybe related? https://github.com/plnice/can-i-drop-jetifier/issues/11

Firestar99 avatar Aug 26 '19 10:08 Firestar99

I'm having a similar issue. I use com.facebook.android:facebook-android-sdk:7.1.0, com.emarsys:mobile-engage-sdk:1.7.1 and com.appsflyer:af-android-sdk:5.1.1. All of those libraries depend on the old support library. Bye Bye Jetifier Gradle Plugin detects them correctly while this plugin doesn't.

bartek-wesolowski avatar Dec 10 '20 12:12 bartek-wesolowski