Fixed
Status Update
Comments
su...@google.com <su...@google.com> #2
Here is the stacktrace from the provided sample project
``` --------- beginning of crash
2018-05-16 13:39:54.438 29258-29258/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: io.kayvan.io18spike, PID: 29258
java.lang.RuntimeException: Unable to start activity ComponentInfo{io.kayvan.io18spike/io.kayvan.io18spike.MainActivity}: android.view.InflateException: Binary XML file line #10: Binary XML file line #10: Error inflating class fragment
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2925)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3060)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:110)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1800)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6649)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:826)
Caused by: android.view.InflateException: Binary XML file line #10: Binary XML file line #10: Error inflating class fragment
Caused by: android.view.InflateException: Binary XML file line #10: Error inflating class fragment
Caused by: java.lang.RuntimeException: Exception inflating io.kayvan.io18spike:navigation/nav_graph line 12
at androidx.navigation.i.a(Unknown Source:124)
at androidx.navigation.d.a(Unknown Source:4)
at androidx.navigation.fragment.NavHostFragment.f(Unknown Source:88)
at android.support.v4.app.h.k(Unknown Source:15)
at android.support.v4.app.n.a(Unknown Source:367)
at android.support.v4.app.n.b(Unknown Source:7)
at android.support.v4.app.n.a(Unknown Source:74)
at android.support.v4.app.n.onCreateView(Unknown Source:216)
at android.support.v4.app.k.a(Unknown Source:4)
at android.support.v4.app.i.a(Unknown Source:2)
at android.support.v4.app.e.onCreateView(Unknown Source:0)
at android.support.v4.app.i.onCreateView(Unknown Source:0)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:780)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at android.support.v7.app.j.b(Unknown Source:23)
at android.support.v7.app.c.setContentView(Unknown Source:4)
at io.kayvan.io18spike.MainActivity.onCreate(Unknown Source:6)
at android.app.Activity.performCreate(Activity.java:7130)
at android.app.Activity.performCreate(Activity.java:7121)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1262)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2905)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3060)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:110)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1800)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6649)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:826)
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: io.kayvan.io18spike.Fragment2
2018-05-16 13:39:54.439 29258-29258/? E/AndroidRuntime: at androidx.navigation.fragment.a$a.a(Unknown Source:58)
at androidx.navigation.fragment.a$a.a(Unknown Source:19)
at androidx.navigation.i.a(Unknown Source:16)
at androidx.navigation.i.a(Unknown Source:133)
at androidx.navigation.i.a(Unknown Source:31)
... 36 more
Caused by: java.lang.ClassNotFoundException: io.kayvan.io18spike.Fragment2
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:453)
at androidx.navigation.fragment.a$a.a(Unknown Source:45)
... 40 more
Caused by: java.lang.ClassNotFoundException: Didn't find class "io.kayvan.io18spike.Fragment2" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/io.kayvan.io18spike-qwaeSphnoJz10eFFCCH9Fw==/base.apk"],nativeLibraryDirectories=[/data/app/io.kayvan.io18spike-qwaeSphnoJz10eFFCCH9Fw==/lib/x86, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 43 more```
``` --------- beginning of crash
2018-05-16 13:39:54.438 29258-29258/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: io.kayvan.io18spike, PID: 29258
java.lang.RuntimeException: Unable to start activity ComponentInfo{io.kayvan.io18spike/io.kayvan.io18spike.MainActivity}: android.view.InflateException: Binary XML file line #10: Binary XML file line #10: Error inflating class fragment
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2925)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3060)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:110)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1800)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6649)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:826)
Caused by: android.view.InflateException: Binary XML file line #10: Binary XML file line #10: Error inflating class fragment
Caused by: android.view.InflateException: Binary XML file line #10: Error inflating class fragment
Caused by: java.lang.RuntimeException: Exception inflating io.kayvan.io18spike:navigation/nav_graph line 12
at androidx.navigation.i.a(Unknown Source:124)
at androidx.navigation.d.a(Unknown Source:4)
at androidx.navigation.fragment.NavHostFragment.f(Unknown Source:88)
at android.support.v4.app.h.k(Unknown Source:15)
at android.support.v4.app.n.a(Unknown Source:367)
at android.support.v4.app.n.b(Unknown Source:7)
at android.support.v4.app.n.a(Unknown Source:74)
at android.support.v4.app.n.onCreateView(Unknown Source:216)
at android.support.v4.app.k.a(Unknown Source:4)
at android.support.v4.app.i.a(Unknown Source:2)
at android.support.v4.app.e.onCreateView(Unknown Source:0)
at android.support.v4.app.i.onCreateView(Unknown Source:0)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:780)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at android.support.v7.app.j.b(Unknown Source:23)
at android.support.v7.app.c.setContentView(Unknown Source:4)
at io.kayvan.io18spike.MainActivity.onCreate(Unknown Source:6)
at android.app.Activity.performCreate(Activity.java:7130)
at android.app.Activity.performCreate(Activity.java:7121)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1262)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2905)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3060)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:110)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1800)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6649)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:826)
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: io.kayvan.io18spike.Fragment2
2018-05-16 13:39:54.439 29258-29258/? E/AndroidRuntime: at androidx.navigation.fragment.a$a.a(Unknown Source:58)
at androidx.navigation.fragment.a$a.a(Unknown Source:19)
at androidx.navigation.i.a(Unknown Source:16)
at androidx.navigation.i.a(Unknown Source:133)
at androidx.navigation.i.a(Unknown Source:31)
... 36 more
Caused by: java.lang.ClassNotFoundException: io.kayvan.io18spike.Fragment2
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:453)
at androidx.navigation.fragment.a$a.a(Unknown Source:45)
... 40 more
Caused by: java.lang.ClassNotFoundException: Didn't find class "io.kayvan.io18spike.Fragment2" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/io.kayvan.io18spike-qwaeSphnoJz10eFFCCH9Fw==/base.apk"],nativeLibraryDirectories=[/data/app/io.kayvan.io18spike-qwaeSphnoJz10eFFCCH9Fw==/lib/x86, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 43 more```
al...@gmail.com <al...@gmail.com> #3
Thanks, this is definitely something we need to fix. As a workaround, you can manually keep each of the Fragments in your navigation graph if you don't reference them elsewhere.
al...@gmail.com <al...@gmail.com> #4
This has been fixed as part of aapt2 that will ship with the Android Gradle Plugin 3.2 Beta 01.
aapt2 will automatically add keep rules for every android:name attribute found in a Navigation XML file. (This is a similar approach used for the android:name attribute on <fragment> elements in layout XML files.)
aapt2 will automatically add keep rules for every android:name attribute found in a Navigation XML file. (This is a similar approach used for the android:name attribute on <fragment> elements in layout XML files.)
ra...@google.com <ra...@google.com> #5
Hum, ran into this, as this keeps happening to me..
Gradle plugin 3.5
Navigation 2.1
Gradle plugin 3.5
Navigation 2.1
be...@gmail.com <be...@gmail.com> #6
Re #5 - please file a new issue with a sample project that reproduces your issue.
al...@gmail.com <al...@gmail.com> #7
android.view.InflateException: Binary XML file line #30 in com.example.customnavigation:layout/activity_main: Binary XML file line #30 in com.example.customnavigation:layout/activity_main: Error inflating class com.google.android.material.navigation.NavigationView
be...@gmail.com <be...@gmail.com> #8
Same problem on my side.
ti...@gmail.com <ti...@gmail.com> #9
same problem
gradle 8.6
AGP 8.2.2
navigation 2.7.7
gradle 8.6
AGP 8.2.2
navigation 2.7.7
ra...@google.com <ra...@google.com>
al...@gmail.com <al...@gmail.com> #10
Do you know when the fix will be available?
su...@google.com <su...@google.com> #11
We're aiming for later this week.
al...@gmail.com <al...@gmail.com> #12
Awesome, I'll get to merge my branch! 😉
ya...@gmail.com <ya...@gmail.com> #13
Hi, may I know,
1) After the end of execution of OneTimeWorkRequest typed worker's doWork(), do we need to cancelAllWorkByTag explicitly to perform "clean up"?
2) After this bug fixed, is there still any hard limit, only how many active job (with different tags) we can schedule on WorkManager?
Thanks.
1) After the end of execution of OneTimeWorkRequest typed worker's doWork(), do we need to cancelAllWorkByTag explicitly to perform "clean up"?
2) After this bug fixed, is there still any hard limit, only how many active job (with different tags) we can schedule on WorkManager?
Thanks.
al...@gmail.com <al...@gmail.com> #14
No, you don't need to perform cleanup and no, there aren't any limits.
su...@google.com <su...@google.com> #15
1. You don't need to perform any cleanup. Completed OneTimeWorkRequests will not re-execute,
2. There is no limit on the number of jobs you can schedule; however, at most 100 will be sent to JobScheduler at a time. The rest will be queued up and sent when appropriate. (That being said, I would advise that you probably don't want to have hundreds of potentially active jobs at any one time.)
2. There is no limit on the number of jobs you can schedule; however, at most 100 will be sent to JobScheduler at a time. The rest will be queued up and sent when appropriate. (That being said, I would advise that you probably don't want to have hundreds of potentially active jobs at any one time.)
ni...@gmail.com <ni...@gmail.com> #16
I still have this issue with 1.0.0-alpha02, like others it seems ( https://github.com/googlecodelabs/android-workmanager/issues/16 ).
As seen on the link, every time I restart my app (using ADB Idea plugin, that kill it then start it again), the numbers of tasks scheduled in JobScheduler increments by the number of periodic tasks scheduled.
I have 4 users that went into the issue and I will use a workaround code I wrote for now.
I see it on Samsung 7.0 devices for now.
As seen on the link, every time I restart my app (using ADB Idea plugin, that kill it then start it again), the numbers of tasks scheduled in JobScheduler increments by the number of periodic tasks scheduled.
I have 4 users that went into the issue and I will use a workaround code I wrote for now.
I see it on Samsung 7.0 devices for now.
ni...@gmail.com <ni...@gmail.com> #17
Here's a sample project that reproduces the issue. I use ADB Idea Plugin with the "ADB Restart App" feature to triggers the issue.
You will see that with each restart, the jobcount from JobScheduler increases by 5, but not the one from WorkManager.
I hope someone will see this message, if I need to make another issue please tell me.
You will see that with each restart, the jobcount from JobScheduler increases by 5, but not the one from WorkManager.
I hope someone will see this message, if I need to make another issue please tell me.
al...@gmail.com <al...@gmail.com> #18
If your issue is specific to periodic work, I'd file a new issue since this one is a little different.
Description
Version used: alpha01
Devices/Android versions reproduced on: >= API 23
There are a few issues here. First of all anytime a job finishes, all jobs that aren't already running are rescheduled. Then, each job generates a new ID which creates an exponential number of jobs for the system or Play Services to manage. Instead, a job should get its ID from the unique job tag or something like that.