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

Tool specifies top-level dependency as using legacy lib, but instead it should point to transitive dependency #19

Open
carstenhag opened this issue Feb 8, 2021 · 3 comments

Comments

@carstenhag
Copy link

We are using implementation 'me.dm7.barcodescanner:zxing:1.9.13' in our project. It's fairly dated and we need to migrate away from it, but it's currently in :D. I wanted to disable jetifier, so I checked with this tool and https://github.com/dipien/bye-bye-jetifier.

Funnily this tool finds the zxing lib as false positive, and the other tool does not find this & another one dipien/bye-bye-jetifier#27

~/Downloads/jetifier-standalone/bin/jetifier-standalone -i ~/Downloads/zxing-1.9.13.aar -o zxing-1.9.13-jetified.aar
WARNING: [Main] No references were rewritten. You don't need to run Jetifier.
 carstenh  ~  git  MX  dcs-app-development-android  %  ./gradlew -Pandroid.enableJetifier=false canIDropJetifier                                         master  2✔  4✎  2+  

> Configure project :app
Warning: The 'kotlin-android-extensions' Gradle plugin is deprecated. Please use this migration guide (https://goo.gle/kotlin-android-extensions-deprecation) to start working with View Binding (https://developer.android.com/topic/libraries/view-binding) and the 'kotlin-parcelize' plugin.

> Configure project :appcenter
Warning: The 'kotlin-android-extensions' Gradle plugin is deprecated. Please use this migration guide (https://goo.gle/kotlin-android-extensions-deprecation) to start working with View Binding (https://developer.android.com/topic/libraries/view-binding) and the 'kotlin-parcelize' plugin.

> Task :canIDropJetifier
========================================
Project app
========================================

Cannot drop Jetifier due to following module dependencies:

* app (module)

Cannot drop Jetifier due to following external dependencies:

* me.dm7.barcodescanner:zxing:1.9.13

========================================
Project appcenter
========================================

No dependencies on old artifacts! Safe to drop Jetifier.


Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.8/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 2s
1 actionable task: 1 executed

@carstenhag
Copy link
Author

Verbose output of jetifier-standalone:

carstenh  ~  git  MX  dcs-app-development-android  ERROR  %  ~/Downloads/jetifier-standalone/bin/jetifier-standalone -i ~/Downloads/zxing-1.9.13.aar -o zxing-1.9.13-jetified.aar -l verbose
VERBOSE: [Config] Using the default config '/default.generated.config'
INFO: [Archive] Extracting: /Users/carstenh/Downloads/zxing-1.9.13.aar
VERBOSE: [Archive] Extracting archive: AndroidManifest.xml
VERBOSE: [Archive] Extracting archive: R.txt
INFO: [Archive] Extracting nested: classes.jar
VERBOSE: [Archive] Extracting archive: me/dm7/barcodescanner/zxing/BuildConfig.class
VERBOSE: [Archive] Extracting archive: me/dm7/barcodescanner/zxing/ZXingScannerView$1.class
VERBOSE: [Archive] Extracting archive: me/dm7/barcodescanner/zxing/ZXingScannerView$ResultHandler.class
VERBOSE: [Archive] Extracting archive: me/dm7/barcodescanner/zxing/ZXingScannerView.class
INFO: [Processor] Started new transformation
INFO: [Processor] - Input file: /Users/carstenh/Downloads/zxing-1.9.13.aar
VERBOSE: [Processor] [Applied: XmlResourcesTransformer] AndroidManifest.xml
VERBOSE: [Processor] [Skipped] R.txt
VERBOSE: [Processor] [Applied: ByteCodeTransformer] me/dm7/barcodescanner/zxing/BuildConfig.class
VERBOSE: [Processor] [Applied: ByteCodeTransformer] me/dm7/barcodescanner/zxing/ZXingScannerView$1.class
VERBOSE: [Processor] [Applied: ByteCodeTransformer] me/dm7/barcodescanner/zxing/ZXingScannerView$ResultHandler.class
VERBOSE: [Processor] [Applied: ByteCodeTransformer] me/dm7/barcodescanner/zxing/ZXingScannerView.class
WARNING: [Main] No references were rewritten. You don't need to run Jetifier.

@carstenhag
Copy link
Author

Okay, after more troubleshooting it seems like jetifier-standalone is misleading/not working right.

I added the dependency to an empty project and with jetifier off, it won't build if added.

/Users/carstenh/git/random/NoJetifierMaterialExample/app/src/main/AndroidManifest.xml:24:18-86 Error:
	Attribute application@appComponentFactory value=(androidx.core.app.CoreComponentFactory) from [androidx.core:core:1.3.2] AndroidManifest.xml:24:18-86
	is also present at [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 value=(android.support.v4.app.CoreComponentFactory).
	Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:6:5-48:19 to override.

@carstenhag
Copy link
Author

Ok, me.dm7.barcodescanner:zxing:1.9.13 requires me.dm7.barcodescanner:core:1.9.13, so that one does need to be transformed.

\--- me.dm7.barcodescanner:zxing:1.9.13
     +--- me.dm7.barcodescanner:core:1.9.13
     |    \--- androidx.legacy:legacy-support-v4:1.0.0
.....

Changing this ticket title to reflect that the specific dependency that causes the issue was not identified.

@carstenhag carstenhag changed the title False positive found, jetifier-standalone says jetifier doesn't need to be ran Tool specifies top-level dependency as using legacy lib, but instead it should point to transitive dependency Feb 9, 2021
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

1 participant