Fixed
Status Update
Comments
do...@traveloka.com <do...@traveloka.com> #2
The project uses plugin androidx.navigation.safeargs (version 1.0.0-alpha04) and that seems to change the version of the models to 3.2.0-beta03, causing the project to require an upgrade. If the plugin is removed from the project then the issue is gone. Can you confirm if the issue is gone after removing the plugin? I have attached a patch with the changes if needed.
pa...@gmail.com <pa...@gmail.com> #3
So maybe this bug needs to be assigned to `androidx.navigation.safeargs` plugin team ?
pa...@gmail.com <pa...@gmail.com> #4
We need to review this plugin and see what it does in general.
The fact that a non final plugin depend on a non final version of our plugin and breaks things is sad but not something we can solve easily on our end. (we need to have other plugin depend on a more stable API artifact rather than specific versions of our plugin.
The fact that a non final plugin depend on a non final version of our plugin and breaks things is sad but not something we can solve easily on our end. (we need to have other plugin depend on a more stable API artifact rather than specific versions of our plugin.
pa...@google.com <pa...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-master-dev
commit d276ac5482afaf12a78ea357fffe40b2a7964301
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Mon Oct 22 14:18:06 2018
Set fixed Android Gradle Plugin dependency version for SafeArgs.
Fixing the version makes it so that if the plugin is updated to a beta
or alpha version for frameworks/support we don't ship SafeArgs with
a non-stable dependency that can cause olders Android Studio versions
to reject syncing.
Bug: 113167627
Test: SafeArgs Tests
Change-Id: Id2de86e4ac724d6d812ea6bd383059737695e948
M buildSrc/src/main/kotlin/androidx/build/dependencies/Dependencies.kt
M navigation/safe-args-gradle-plugin/build.gradle
https://android-review.googlesource.com/798471
https://goto.google.com/android-sha1/d276ac5482afaf12a78ea357fffe40b2a7964301
Branch: androidx-master-dev
commit d276ac5482afaf12a78ea357fffe40b2a7964301
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Mon Oct 22 14:18:06 2018
Set fixed Android Gradle Plugin dependency version for SafeArgs.
Fixing the version makes it so that if the plugin is updated to a beta
or alpha version for frameworks/support we don't ship SafeArgs with
a non-stable dependency that can cause olders Android Studio versions
to reject syncing.
Bug: 113167627
Test: SafeArgs Tests
Change-Id: Id2de86e4ac724d6d812ea6bd383059737695e948
M buildSrc/src/main/kotlin/androidx/build/dependencies/Dependencies.kt
M navigation/safe-args-gradle-plugin/build.gradle
ap...@google.com <ap...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 0ca83fae309187d476d8e5baa59d7e0f33c6f8d8
Author: Filip Pavlis <pavlis@google.com>
Date: Fri Oct 25 16:34:14 2019
Fix proguard regular expression.
The matcher in dontwarn was too hungry and was also matching new
lines and comments.
Also make sure we don' match comments in ProGuardClassSpecParser.
Test: Added
Bug: b/134100420
Change-Id: I77cf40dd880b5bee9a30dad82c82dc1fa5a71aa9
M jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/proguard/ProGuardClassFilterParser.kt
M jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/proguard/ProGuardClassSpecParser.kt
M jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/proguard/patterns/PatternHelper.kt
M jetifier/jetifier/processor/src/test/kotlin/com/android/tools/build/jetifier/processor/transform/proguard/ClassFilterTest.kt
M jetifier/jetifier/processor/src/test/kotlin/com/android/tools/build/jetifier/processor/transform/proguard/ProguardSamplesTest.kt
https://android-review.googlesource.com/1151458
https://goto.google.com/android-sha1/0ca83fae309187d476d8e5baa59d7e0f33c6f8d8
Branch: androidx-master-dev
commit 0ca83fae309187d476d8e5baa59d7e0f33c6f8d8
Author: Filip Pavlis <pavlis@google.com>
Date: Fri Oct 25 16:34:14 2019
Fix proguard regular expression.
The matcher in dontwarn was too hungry and was also matching new
lines and comments.
Also make sure we don' match comments in ProGuardClassSpecParser.
Test: Added
Bug:
Change-Id: I77cf40dd880b5bee9a30dad82c82dc1fa5a71aa9
M jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/proguard/ProGuardClassFilterParser.kt
M jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/proguard/ProGuardClassSpecParser.kt
M jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/proguard/patterns/PatternHelper.kt
M jetifier/jetifier/processor/src/test/kotlin/com/android/tools/build/jetifier/processor/transform/proguard/ClassFilterTest.kt
M jetifier/jetifier/processor/src/test/kotlin/com/android/tools/build/jetifier/processor/transform/proguard/ProguardSamplesTest.kt
pa...@google.com <pa...@google.com> #8
Jetifier 1.0.0-beta08 was released and has a fix for this.
To avoid waiting for new Android Studio you can workaround this in the meantime by forcing usage of a new version of jetifier in gradle:
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:x.y.z'
classpath 'com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta08' // <- Add this
}
}
To avoid waiting for new Android Studio you can workaround this in the meantime by forcing usage of a new version of jetifier in gradle:
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:x.y.z'
classpath 'com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta08' // <- Add this
}
}
pa...@gmail.com <pa...@gmail.com> #9
Thanks pa..., it's really nice to receive updates and useful details (root cause, CL, workaround) about the issue. I wish everyone was like this!
Description
Java version "1.8.0_121"
Jetifier version: 1.0.0-beta04
Let there be a Library Foo with the following 'proguard-rules.txt' file:
# DBFlow
-keep class * extends com.raizlabs.android.dbflow.config.DatabaseHolder { *; }
-dontwarn com.raizlabs.android.dbflow.**
# Note: the configuration keeps the entry point 'com.raizlabs.android.dbflow.config.FlowManager$GlobalDatabaseHolder { FlowManager$GlobalDatabaseHolder(com.raizlabs.android.dbflow.config.FlowManager$1); }', but not the descriptor class 'com.raizlabs.android.dbflow.config.FlowManager$1'
-keep class com.raizlabs.android.dbflow.config.FlowManager$*
When trying to jetify this library:
./jetifier-standalone -i /Users/someuser/Downloads/foo/foo.aar -o newfoo.aar
The Jetifier fails with the following output:
Exception in thread "main" java.util.regex.PatternSyntaxException: Illegal repetition near index 147
com/raizlabs/android/dbflow/.*
# Note: the configuration keeps the entry point 'com/raizlabs/android/dbflow/config/FlowManager$GlobalDatabaseHolder { FlowManager$GlobalDatabaseHolder(com/raizlabs/android/dbflow/config/FlowManager$1); }'
^
at java.util.regex.Pattern.error(Pattern.java:1955)
at java.util.regex.Pattern.closure(Pattern.java:3157)
at java.util.regex.Pattern.sequence(Pattern.java:2134)
at java.util.regex.Pattern.expr(Pattern.java:1996)
at java.util.regex.Pattern.compile(Pattern.java:1696)
at java.util.regex.Pattern.<init>(Pattern.java:1351)
at java.util.regex.Pattern.compile(Pattern.java:1028)
at com.android.tools.build.jetifier.core.type.TypesMap.matchOldProguardForNewTypes(TypesMap.kt:112)
[...]
If i remove the notes, the new 'proguard-rules.txt' looks like this:
# DBFlow
-keep class * extends com.raizlabs.android.dbflow.config.DatabaseHolder { *; }
-dontwarn com.raizlabs.android.dbflow.**
-keep class com.raizlabs.android.dbflow.config.FlowManager$*
And this runs through the jetifier just fine. Please provide a fix for this issue, since i have to patch my dependencies currently in order to make AndroidX work for me.