Fixed
Status Update
Comments
he...@gmail.com <he...@gmail.com> #2
I guess technically, the ProGuard rule should be on androidx.work.NonBlockingWorker subclasses, but I'd also be okay with just not using reflection to access the Worker(Context, WorkerParamters) constructor and skipping the need for a ProGuard rule at all.
ad...@google.com <ad...@google.com>
al...@gmail.com <al...@gmail.com> #4
The fix will be available in alpha10.
he...@gmail.com <he...@gmail.com> #5
I tried to use the ProGuard configuration which is linked in comment #3 in my project.
The release build fails and the following warnings are printed:
22:22:06.567 [QUIET] [system.out] Note: the configuration keeps the entry point 'androidx.work.NonBlockingWorker { NonBlockingWorker(android.content.Context,androidx.work.WorkerParameters); }', but not the descriptor class 'androidx.work.WorkerParameters'
22:22:06.567 [QUIET] [system.out] Note: the configuration keeps the entry point 'androidx.work.NonBlockingWorker { void internalInit(android.content.Context,androidx.work.WorkerParameters); }', but not the descriptor class 'androidx.work.WorkerParameters'
22:22:06.567 [QUIET] [system.out] Note: the configuration keeps the entry point 'androidx.work.Worker { Worker(android.content.Context,androidx.work.WorkerParameters); }', but not the descriptor class 'androidx.work.WorkerParameters'
The app is opensource if you want to run the release build yourself. Here is the branch (WIP):
https://github.com/EventFahrplan/EventFahrplan/tree/workmanager
Please run: ./gradlew --info --debug aCcc34c3Release
The release build fails and the following warnings are printed:
22:22:06.567 [QUIET] [system.out] Note: the configuration keeps the entry point 'androidx.work.NonBlockingWorker { NonBlockingWorker(android.content.Context,androidx.work.WorkerParameters); }', but not the descriptor class 'androidx.work.WorkerParameters'
22:22:06.567 [QUIET] [system.out] Note: the configuration keeps the entry point 'androidx.work.NonBlockingWorker { void internalInit(android.content.Context,androidx.work.WorkerParameters); }', but not the descriptor class 'androidx.work.WorkerParameters'
22:22:06.567 [QUIET] [system.out] Note: the configuration keeps the entry point 'androidx.work.Worker { Worker(android.content.Context,androidx.work.WorkerParameters); }', but not the descriptor class 'androidx.work.WorkerParameters'
The app is opensource if you want to run the release build yourself. Here is the branch (WIP):
Please run: ./gradlew --info --debug aCcc34c3Release
al...@gmail.com <al...@gmail.com> #6
Ah, that's because we have a typo in our Proguard file. Change WorkParameters to WorkerParameters.
he...@gmail.com <he...@gmail.com> #7
Thank you for quick reply. I changed this here:
https://github.com/EventFahrplan/EventFahrplan/commit/7567331dc69a303d5c423850a97bf29005ea7b1c
The release build still fails though. Here is a part of the log output:
23:43:15.760 [ERROR] [system.err] Note: there were 11 duplicate class definitions.
23:43:15.760 [ERROR] [system.err] (http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass )
23:43:15.822 [QUIET] [system.out] Initializing...
23:43:15.827 [QUIET] [system.out] Note: the configuration refers to the unknown class 'androidx.work.impl.background.firebase.FirebaseJobScheduler'
23:43:15.845 [QUIET] [system.out] Note: the configuration refers to the unknown class 'androidx.work.WorkParameters'
23:43:15.857 [QUIET] [system.out] Note: the configuration refers to the unknown class 'androidx.work.impl.background.firebase.FirebaseJobScheduler'
23:43:16.272 [ERROR] [system.err] Warning: androidx.concurrent.futures.AbstractFuture$UnsafeAtomicHelper: can't find referenced class sun.misc.Unsafe
23:43:16.272 [ERROR] [system.err] Warning: androidx.concurrent.futures.AbstractFuture$UnsafeAtomicHelper: can't find referenced class sun.misc.Unsafe
23:43:16.272 [ERROR] [system.err] Warning: androidx.concurrent.futures.AbstractFuture$UnsafeAtomicHelper: can't find referenced class sun.misc.Unsafe
23:43:16.272 [ERROR] [system.err] Warning: androidx.concurrent.futures.AbstractFuture$UnsafeAtomicHelper: can't find referenced class sun.misc.Unsafe
23:43:16.272 [ERROR] [system.err] Warning: androidx.concurrent.futures.AbstractFuture$UnsafeAtomicHelper: can't find referenced class sun.misc.Unsafe
23:43:16.272 [ERROR] [system.err] Warning: androidx.concurrent.futures.AbstractFuture$UnsafeAtomicHelper: can't find referenced class sun.misc.Unsafe
23:43:16.272 [ERROR] [system.err] Warning: androidx.concurrent.futures.AbstractFuture$UnsafeAtomicHelper: can't find referenced class sun.misc.Unsafe
23:43:16.272 [ERROR] [system.err] Warning: androidx.concurrent.futures.AbstractFuture$UnsafeAtomicHelper$1: can't find referenced class sun.misc.Unsafe
23:43:16.273 [ERROR] [system.err] Warning: androidx.concurrent.futures.AbstractFuture$UnsafeAtomicHelper$1: can't find referenced class sun.misc.Unsafe
23:43:16.273 [ERROR] [system.err] Warning: androidx.concurrent.futures.AbstractFuture$UnsafeAtomicHelper$1: can't find referenced class sun.misc.Unsafe
23:43:16.273 [ERROR] [system.err] Warning: androidx.concurrent.futures.AbstractFuture$UnsafeAtomicHelper$1: can't find referenced class sun.misc.Unsafe
23:43:16.285 [ERROR] [system.err] Warning: androidx.work.impl.background.systemjob.SystemJobService: can't find referenced method 'android.net.Network getNetwork()' in library class android.app.job.JobParameters
23:43:16.883 [QUIET] [system.out] Note: androidx.work.impl.Schedulers: can't find dynamically referenced class androidx.work.impl.background.firebase.FirebaseJobService
23:43:16.883 [QUIET] [system.out] Note: androidx.work.impl.Schedulers: can't find dynamically referenced class androidx.work.impl.background.firebase.FirebaseJobScheduler
23:43:16.911 [QUIET] [system.out] Note: kotlin.internal.PlatformImplementationsKt: can't find dynamically referenced class kotlin.internal.jdk8.JDK8PlatformImplementations
23:43:16.911 [QUIET] [system.out] Note: kotlin.internal.PlatformImplementationsKt: can't find dynamically referenced class kotlin.internal.JRE8PlatformImplementations
23:43:16.912 [QUIET] [system.out] Note: kotlin.internal.PlatformImplementationsKt: can't find dynamically referenced class kotlin.internal.jdk7.JDK7PlatformImplementations
23:43:16.912 [QUIET] [system.out] Note: kotlin.internal.PlatformImplementationsKt: can't find dynamically referenced class kotlin.internal.JRE7PlatformImplementations
23:43:16.914 [QUIET] [system.out] Note: kotlin.jvm.internal.Reflection: can't find dynamically referenced class kotlin.reflect.jvm.internal.ReflectionFactoryImpl
23:43:16.944 [QUIET] [system.out] Note: okhttp3.internal.platform.AndroidPlatform: can't find dynamically referenced class com.android.org.conscrypt.SSLParametersImpl
23:43:16.944 [QUIET] [system.out] Note: okhttp3.internal.platform.AndroidPlatform: can't find dynamically referenced class org.apache.harmony.xnet.provider.jsse.SSLParametersImpl
23:43:16.944 [QUIET] [system.out] Note: okhttp3.internal.platform.AndroidPlatform$CloseGuard: can't find dynamically referenced class dalvik.system.CloseGuard
23:43:16.944 [QUIET] [system.out] Note: okhttp3.internal.platform.ConscryptPlatform: can't find dynamically referenced class org.conscrypt.ConscryptEngineSocket
23:43:16.944 [QUIET] [system.out] Note: okhttp3.internal.platform.Platform: can't find dynamically referenced class sun.security.ssl.SSLContextImpl
The release build still fails though. Here is a part of the log output:
23:43:15.760 [ERROR] [system.err] Note: there were 11 duplicate class definitions.
23:43:15.760 [ERROR] [system.err] (
23:43:15.822 [QUIET] [system.out] Initializing...
23:43:15.827 [QUIET] [system.out] Note: the configuration refers to the unknown class 'androidx.work.impl.background.firebase.FirebaseJobScheduler'
23:43:15.845 [QUIET] [system.out] Note: the configuration refers to the unknown class 'androidx.work.WorkParameters'
23:43:15.857 [QUIET] [system.out] Note: the configuration refers to the unknown class 'androidx.work.impl.background.firebase.FirebaseJobScheduler'
23:43:16.272 [ERROR] [system.err] Warning: androidx.concurrent.futures.AbstractFuture$UnsafeAtomicHelper: can't find referenced class sun.misc.Unsafe
23:43:16.272 [ERROR] [system.err] Warning: androidx.concurrent.futures.AbstractFuture$UnsafeAtomicHelper: can't find referenced class sun.misc.Unsafe
23:43:16.272 [ERROR] [system.err] Warning: androidx.concurrent.futures.AbstractFuture$UnsafeAtomicHelper: can't find referenced class sun.misc.Unsafe
23:43:16.272 [ERROR] [system.err] Warning: androidx.concurrent.futures.AbstractFuture$UnsafeAtomicHelper: can't find referenced class sun.misc.Unsafe
23:43:16.272 [ERROR] [system.err] Warning: androidx.concurrent.futures.AbstractFuture$UnsafeAtomicHelper: can't find referenced class sun.misc.Unsafe
23:43:16.272 [ERROR] [system.err] Warning: androidx.concurrent.futures.AbstractFuture$UnsafeAtomicHelper: can't find referenced class sun.misc.Unsafe
23:43:16.272 [ERROR] [system.err] Warning: androidx.concurrent.futures.AbstractFuture$UnsafeAtomicHelper: can't find referenced class sun.misc.Unsafe
23:43:16.272 [ERROR] [system.err] Warning: androidx.concurrent.futures.AbstractFuture$UnsafeAtomicHelper$1: can't find referenced class sun.misc.Unsafe
23:43:16.273 [ERROR] [system.err] Warning: androidx.concurrent.futures.AbstractFuture$UnsafeAtomicHelper$1: can't find referenced class sun.misc.Unsafe
23:43:16.273 [ERROR] [system.err] Warning: androidx.concurrent.futures.AbstractFuture$UnsafeAtomicHelper$1: can't find referenced class sun.misc.Unsafe
23:43:16.273 [ERROR] [system.err] Warning: androidx.concurrent.futures.AbstractFuture$UnsafeAtomicHelper$1: can't find referenced class sun.misc.Unsafe
23:43:16.285 [ERROR] [system.err] Warning: androidx.work.impl.background.systemjob.SystemJobService: can't find referenced method 'android.net.Network getNetwork()' in library class android.app.job.JobParameters
23:43:16.883 [QUIET] [system.out] Note: androidx.work.impl.Schedulers: can't find dynamically referenced class androidx.work.impl.background.firebase.FirebaseJobService
23:43:16.883 [QUIET] [system.out] Note: androidx.work.impl.Schedulers: can't find dynamically referenced class androidx.work.impl.background.firebase.FirebaseJobScheduler
23:43:16.911 [QUIET] [system.out] Note: kotlin.internal.PlatformImplementationsKt: can't find dynamically referenced class kotlin.internal.jdk8.JDK8PlatformImplementations
23:43:16.911 [QUIET] [system.out] Note: kotlin.internal.PlatformImplementationsKt: can't find dynamically referenced class kotlin.internal.JRE8PlatformImplementations
23:43:16.912 [QUIET] [system.out] Note: kotlin.internal.PlatformImplementationsKt: can't find dynamically referenced class kotlin.internal.jdk7.JDK7PlatformImplementations
23:43:16.912 [QUIET] [system.out] Note: kotlin.internal.PlatformImplementationsKt: can't find dynamically referenced class kotlin.internal.JRE7PlatformImplementations
23:43:16.914 [QUIET] [system.out] Note: kotlin.jvm.internal.Reflection: can't find dynamically referenced class kotlin.reflect.jvm.internal.ReflectionFactoryImpl
23:43:16.944 [QUIET] [system.out] Note: okhttp3.internal.platform.AndroidPlatform: can't find dynamically referenced class com.android.org.conscrypt.SSLParametersImpl
23:43:16.944 [QUIET] [system.out] Note: okhttp3.internal.platform.AndroidPlatform: can't find dynamically referenced class org.apache.harmony.xnet.provider.jsse.SSLParametersImpl
23:43:16.944 [QUIET] [system.out] Note: okhttp3.internal.platform.AndroidPlatform$CloseGuard: can't find dynamically referenced class dalvik.system.CloseGuard
23:43:16.944 [QUIET] [system.out] Note: okhttp3.internal.platform.ConscryptPlatform: can't find dynamically referenced class org.conscrypt.ConscryptEngineSocket
23:43:16.944 [QUIET] [system.out] Note: okhttp3.internal.platform.Platform: can't find dynamically referenced class sun.security.ssl.SSLContextImpl
il...@google.com <il...@google.com>
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #8
I think your compileSdk is too low. WorkManager requires it to be 28 or higher: https://irina-dot-devsite.googleplex.com/topic/libraries/architecture/adding-components
I'm not sure why you are running into the warnings about Unsafe, but you can try using -dontwarn sun.misc.Unsafe in your proguard file to see if it helps. We haven't observed it ourselves.
For what it's worth, one of the notes is referring to WorkParameters still - are you sure it was changed properly?
I'm not sure why you are running into the warnings about Unsafe, but you can try using -dontwarn sun.misc.Unsafe in your proguard file to see if it helps. We haven't observed it ourselves.
For what it's worth, one of the notes is referring to WorkParameters still - are you sure it was changed properly?
Description
2) hide fragment (A)
a) onHiddenChanged() gets called for (A)
b) onHiddenChanged() does not get called for (B)
My expectation would be if the fragment itself is hidden, it's children would also be constituted as hidden. A general workaround would be to never rely on a Fragment's hidden state since if you made your fragment correctly, you wouldn't need to worry about the context in which the fragment is being used (either in a child fragment manager or not). The fact that you have to rely no the context in which the fragment is used makes onHiddenChanged() and isHidden() in most cases useless. This means we are left having to add a OnGlobalLayoutChangeListener and listen for whether the root view of the fragment is visible or not.