Fixed
Status Update
Comments
il...@google.com <il...@google.com> #2
I don't think #1 makes a lot of sense. There are already potentially libraries out there without that metadata.
#2 makes the most sense to me, but in case we cannot be 100% reliable we should allow blacklisting libraries as described in #3. This should probably be handled globally for a project (in gradle.properpies rather than in the DSL)
#2 makes the most sense to me, but in case we cannot be 100% reliable we should allow blacklisting libraries as described in #3. This should probably be handled globally for a project (in gradle.properpies rather than in the DSL)
my...@gmail.com <my...@gmail.com> #3
As I have mentioned I don't think there is a silver bullet. #2 does not work on 100% and #1 will take time before devs will provide the metadata. #3 is in my opinion very important to introduce asap, as the developers have no way how to workaround it at this stage. Also in the future there can be any other issue and there is nothing wrong in doing #3 until we figure out something robust (or for instance finally migrate work manager and navigation to androidx that would make #2 a feasible solution).
jb...@google.com <jb...@google.com>
ap...@google.com <ap...@google.com> #4
Yes, I'm working on #3 right now to unblock users. We can continue thinking about #2.
ap...@google.com <ap...@google.com> #5
Starting with AGP 3.3.0-rc01 and 3.4.0-alpha04, to blacklist libraries that should not be jetified, users can add a comma-separated list of regular expressions to the following property in the gradle.properties file:
android.jetifier.blacklist = ...
If a library's absolute path contains a substring that matches one of the regular expressions, the library won't be jetified.
For example, if the property is
android.jetifier.blacklist = doNot.*\\.jar, foo
then "/path/to/doNotJetify.jar" won't be jetified.
Change-Id: I6531fe0faafa45dc2811c5223ba199ccce5fee53
Note that this is only a temporary workaround while we work on a proper solution.
android.jetifier.blacklist = ...
If a library's absolute path contains a substring that matches one of the regular expressions, the library won't be jetified.
For example, if the property is
android.jetifier.blacklist = doNot.*\\.jar, foo
then "/path/to/doNotJetify.jar" won't be jetified.
Change-Id: I6531fe0faafa45dc2811c5223ba199ccce5fee53
Note that this is only a temporary workaround while we work on a proper solution.
ap...@google.com <ap...@google.com> #6
Hi. I'm trying to use the `android.jetifier.blacklist` workaround to prevent jetify from processing lombok (which generates a DuplicateEntry exception when trying to transform). I can't see to get it working though. Here are the relevant files:
gradle.properties:
```
android.enableJetifier=true
android.jetifier.blacklist = .*lombok.*
android.useAndroidX=true
```
build.gradle:
```
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta02'
classpath 'com.android.tools.build:gradle:3.3.0-beta03'
}
}
plugins {
id 'com.android.application' //version '3.3.0-beta03'
id 'jacoco'
}
```
gradle.properties:
```
android.enableJetifier=true
android.jetifier.blacklist = .*lombok.*
android.useAndroidX=true
```
build.gradle:
```
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta02'
classpath 'com.android.tools.build:gradle:3.3.0-beta03'
}
}
plugins {
id 'com.android.application' //version '3.3.0-beta03'
id 'jacoco'
}
```
jb...@google.com <jb...@google.com> #7
As mentioned at comment #5 , you will need to use AGP 3.3.0-rc01+ or 3.4.0-alpha04+ for the workaround to take effect.
ap...@google.com <ap...@google.com> #8
I am interested in the ability to blacklist dependencies from being jettified as well. The binary rewrite messes with AspectJ aspect classes. It re-introduces this problem: https://issuetracker.google.com/issues/119153999
Description
This code snippet will no longer work with lint tools
27.1.0+
(which is what's used in AGP 4.1.0+).It looks like it should be changed to
buildVariant
, and then there are changed APIs for accessing library info (the.libraries
call at the end will also need fixing).This results in the following failure when I build with newer lint tools and AGP 4.1.0-beta05 in our project