Fixed
Status Update
Comments
il...@google.com <il...@google.com>
il...@google.com <il...@google.com> #2
It turns out this issue is due to by navArgs()
moving to navigation-common
, but the ProGuard rules still being located in the (now empty) navigation-common-ktx
. This means you can work around this issue by explicitly adding a dependency on androidx.navigation:navigation-common-ktx:2.4.0-alpha02
.
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit 55af5f168e5a1e6dc73c8d35ac79598cb4ae5bd8
Author: Ian Lake <ilake@google.com>
Date: Wed Jun 09 16:57:14 2021
Move ProGuard rules from navigation-common-ktx to common
NavArgsLazy was moved to navigation-common, but
the related proguard-rules.pro wasn't moved with it.
This meant that apps that didn't specifically include
the (now empty) navigation-common-ktx artifact wouldn't
get the correct set of ProGuard rules.
Test: tested in sample app
BUG: 190082521
Relnote: "ProGuard rules for `by navArgs()` now properly
apply when using `navigation-common` or any artifacts
that depend on it."
Change-Id: I688009632403c98afe728d856ce91cd056ef32a5
M navigation/navigation-common-ktx/build.gradle
M navigation/navigation-common/build.gradle
M navigation/navigation-common/proguard-rules.pro
https://android-review.googlesource.com/1732586
Branch: androidx-main
commit 55af5f168e5a1e6dc73c8d35ac79598cb4ae5bd8
Author: Ian Lake <ilake@google.com>
Date: Wed Jun 09 16:57:14 2021
Move ProGuard rules from navigation-common-ktx to common
NavArgsLazy was moved to navigation-common, but
the related proguard-rules.pro wasn't moved with it.
This meant that apps that didn't specifically include
the (now empty) navigation-common-ktx artifact wouldn't
get the correct set of ProGuard rules.
Test: tested in sample app
BUG: 190082521
Relnote: "ProGuard rules for `by navArgs()` now properly
apply when using `navigation-common` or any artifacts
that depend on it."
Change-Id: I688009632403c98afe728d856ce91cd056ef32a5
M navigation/navigation-common-ktx/build.gradle
M navigation/navigation-common/build.gradle
M navigation/navigation-common/proguard-rules.pro
il...@google.com <il...@google.com> #4
This has been fixed internally and will be available in Navigation 2.4.0-alpha03.
Description
Component used: Navigation Safe Args Kotlin Plugin
Version used: 2.4.0-alpha02, AGP 4.2.0-beta03
After upgrading to Navigation 2.4.0-alpha02 and building a minified version of my app , my app crashed with an exception that said that the
fromBundle
method couldn't be found.I use the
by navArgs()
extension, which uses reflection to access this method, so I depended on Navigation's included ProGuard keep rules to properly keep that method.I found that I could work around this issue via this commit :
Essentially just making sure that the
Companion
class is kept. After adding that ProGuard rule, thefromBundle()
class was successfully kept. I'm not sure why that helped, since I'm pretty sure that the format of thefromBundle()
didn't change since Navigation 2.3.5?Reproduction steps:
minifyEnabled true
to the./gradlew assembleDebug
and analyze the resulting APK to verify that theChooseProviderFragmentArgs.fromBundle()
method exists (it won't) 4a) Alternatively, install Muzei, Activate it as your wallpaper, then select the 'Sources' screen. Muzei should not crash.