TBLauncher icon indicating copy to clipboard operation
TBLauncher copied to clipboard

Unable to add widget miui

Open t-e-s-tweb opened this issue 2 years ago • 6 comments

Description

Unable to add widgets in Miui 13

Context

As far as I remember from the very first version of tiny bit I haven't been able to add widgets.

Steps to Reproduce

To reproduce the behavior:

  1. Go to desktop
  2. Click on add widget
  3. Nothing happens for a few seconds
  4. Error that unable to add widget

Expected behavior

Widget add screen should have been displayed

Screenshots

Device info

  • Device: MI 10T
  • OS: Android 11 MiUI 13
  • TinyBit Launcher version: 6.12

t-e-s-tweb avatar Apr 18 '22 23:04 t-e-s-tweb

It may be a permission thing. I don't have a phone with miui to test. Can you at least provide a logcat?

TBog avatar Apr 19 '22 09:04 TBog

The similar issue with Kiss should provide quite some informations and as I just wrote there, it's maybe an "on the fly" permission problem, as I get a pop-up that ask me if I want to allow access to the widget data when I create one with Nova7.

nv2p avatar May 17 '22 17:05 nv2p

I don't have a device to test this. If I make some debug builds could you test and post the logcat?

TBog avatar May 17 '22 17:05 TBog

I will happily help and take the occasion to thank you for your app. I'm no developer and never used logcat, so small guidances will maybe be needed, but no problem with installing an apk and running some adb commands, if that's the idea.

nv2p avatar May 18 '22 06:05 nv2p

Capture a bug report from a device

Official steps

To get a bug report directly from your device, do the following:

  1. Be sure you have Developer Options enabled.
  2. In Developer options, tap Take bug report.
  3. Select the type of bug report you want and tap Report.
  4. After a moment you get a notification that the bug report is ready (see figure 2).

To share the bug report, tap the notification.

Alternative

  • From 2016 - haven't tested if this still works - https://android.gadgethacks.com/how-to/android-basics-capture-logcat-for-detailed-bug-reports-0167774/
    • video https://www.youtube.com/watch?v=W6iDw76UpQw
  • From 2021 - Capturing The Bug Report Through ADB Command. - see point 3

TBog avatar May 23 '22 13:05 TBog

Thanks for the pointers. On Xiaomi, there is no Take bug report... It seems taping few times on "CPU" in All Specs achieve the same (https://c.mi.com/thread-3430629-1-0.html). As with the alternative through adb, I get a zip file, with a lot of informations (quite a mess for an uninitiated like me), some of them "sensitives", as warned by Xiaomi. It would be nice if you could tell me what to post or send you (how?), if possible.

By guidance, I was more thinking about something like a precise logcat command (which by default also produce a lot of informations). I found out, for example, that running adb logcat *:W shows only the warnings, errors or more important, which make it easier to read and catch what happen. Would this be enough useful for you?

05-23 20:14:43.852  1788  4699 W ActivityTaskManager: Tried to set launchTime (0) < mLastActivityLaunchTime (350372297)
05-23 20:14:43.852  1014  1057 E ANDR-PERF-LM: MetaMeter: handleAsync() 164: AdaptLaunch Invalid Async
05-23 20:14:43.958  3386  4738 W RecentsModel: getRunningTask
05-23 20:14:43.960  3386  4738 W RecentsModel: getRunningTask   taskInfo=TaskInfo{userId=0 stackId=1 taskId=1596 displayId=0 isRunning=true baseIntent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10800000 cmp=rocks.tbog.tblauncher/.TBLauncherActivity } baseActivity=ComponentInfo{rocks.tbog.tblauncher/rocks.tbog.tblauncher.TBLauncherActivity} topActivity=ComponentInfo{com.android.settings/com.android.settings.AppWidgetPickActivity} origActivity=null realActivity=ComponentInfo{rocks.tbog.tblauncher/rocks.tbog.tblauncher.TBLauncherActivity} numActivities=2 lastActiveTime=1248198142 supportsSplitScreenMultiWindow=true resizeMode=2 isResizeable=true token=android.window.WindowContainerToken@6e0eba2 topActivityType=2 pictureInPictureParams=null topActivityInfo=ActivityInfo{6dbe033 com.android.settings.AppWidgetPickActivity}
05-23 20:14:43.960  3386  4738 W RecentsModel: getTaskInfoIgnoreHomeAndFreeform   taskInfo=ComponentInfo{rocks.tbog.tblauncher/rocks.tbog.tblauncher.TBLauncherActivity}
05-23 20:14:43.961  3386  4738 E ActivityManagerWrapper: get all recent tasks force including 1596
05-23 20:14:43.962  3386  4738 E ActivityManagerWrapper: getRecentTasks: size=8
05-23 20:14:43.962  3386  4738 E ActivityManagerWrapper: getRecentTasks: taskId=2705   userId=0   baseIntent=Intent { act=miui.intent.action.OPEN flag=268435456 cmp=ComponentInfo{com.mi.android.globalFileexplorer/com.android.fileexplorer.FileExplorerTabActivity} }
05-23 20:14:43.962  3386  4738 E ActivityManagerWrapper: getRecentTasks: taskId=2701   userId=0   baseIntent=Intent { act=android.settings.SETTINGS flag=335544320 cmp=ComponentInfo{com.android.settings/com.android.settings.MiuiSettings} }
05-23 20:14:43.962  3386  4738 E ActivityManagerWrapper: getRecentTasks: taskId=2707   userId=0   baseIntent=Intent { act=null flag=276824064 cmp=ComponentInfo{com.miui.bugreport/com.miui.bugreport.ui.SubmitDialogActivity} }
05-23 20:14:43.962  3386  4738 E ActivityManagerWrapper: getRecentTasks: taskId=2706   userId=0   baseIntent=Intent { act=null flag=276824064 cmp=ComponentInfo{com.android.settings/com.android.settings.Settings$UsbDetailsActivity} }
05-23 20:14:43.962  3386  4738 E ActivityManagerWrapper: getRecentTasks: taskId=2703   userId=0   baseIntent=Intent { act=null flag=276824064 cmp=ComponentInfo{com.whatsapp/com.whatsapp.voipcalling.VoipActivityV2} }
05-23 20:14:43.962  3386  4738 E ActivityManagerWrapper: getRecentTasks: taskId=2702   userId=0   baseIntent=Intent { act=null flag=268435456 cmp=ComponentInfo{rocks.tbog.tblauncher/rocks.tbog.tblauncher.SettingsActivity} }
05-23 20:14:43.962  3386  4738 E ActivityManagerWrapper: getRecentTasks: taskId=2698   userId=0   baseIntent=Intent { act=mozac.feature.mediasession.SWITCH_TAB flag=268435456 cmp=ComponentInfo{org.mozilla.fennec_fdroid/org.mozilla.fennec_fdroid.App} }
05-23 20:14:43.962  3386  4738 E ActivityManagerWrapper: getRecentTasks: taskId=2675   userId=0   baseIntent=Intent { act=android.intent.action.VIEW flag=276824064 cmp=ComponentInfo{android/com.android.internal.app.ResolverActivity} }
05-23 20:14:43.963  3386  4738 E ReflectUtils: getField
05-23 20:14:43.963  3386  4738 E ReflectUtils: java.lang.NoSuchFieldException: No field childrenTaskInfos in class Landroid/app/ActivityManager$RecentTaskInfo; (declaration of 'android.app.ActivityManager$RecentTaskInfo' appears in /system/framework/framework.jar)
05-23 20:14:43.963  3386  4738 E ReflectUtils:  at java.lang.Class.getDeclaredField(Native Method)
05-23 20:14:43.963  3386  4738 E ReflectUtils:  at com.android.systemui.shared.recents.utilities.ReflectUtils.getField(ReflectUtils.java:55)
05-23 20:14:43.963  3386  4738 E ReflectUtils:  at com.android.systemui.shared.recents.utilities.ReflectUtils.getField(ReflectUtils.java:82)
05-23 20:14:43.963  3386  4738 E ReflectUtils:  at com.android.systemui.shared.recents.utilities.ReflectUtils.getObjectField(ReflectUtils.java:69)
05-23 20:14:43.963  3386  4738 E ReflectUtils:  at com.android.systemui.shared.recents.model.RecentsTaskLoadPlan.preloadPlan(RecentsTaskLoadPlan.java:216)
05-23 20:14:43.963  3386  4738 E ReflectUtils:  at com.android.systemui.shared.recents.model.RecentsTaskLoader.preloadTasks(RecentsTaskLoader.java:401)
05-23 20:14:43.963  3386  4738 E ReflectUtils:  at com.miui.home.recents.RecentsModel.preloadRecents(RecentsModel.java:143)
05-23 20:14:43.963  3386  4738 E ReflectUtils:  at com.miui.home.recents.RecentsModel$HandlerCallbacks.handleMessage(RecentsModel.java:236)
05-23 20:14:43.963  3386  4738 E ReflectUtils:  at android.os.Handler.dispatchMessage(Handler.java:102)
05-23 20:14:43.963  3386  4738 E ReflectUtils:  at android.os.Looper.loop(Looper.java:236)
05-23 20:14:43.963  3386  4738 E ReflectUtils:  at android.os.HandlerThread.run(HandlerThread.java:67)
05-23 20:14:43.964  3386  4738 E ReflectUtils: getField
05-23 20:14:43.964  3386  4738 E ReflectUtils: java.lang.NoSuchFieldException: No field childrenTaskInfos in class Landroid/app/ActivityManager$RecentTaskInfo; (declaration of 'android.app.ActivityManager$RecentTaskInfo' appears in /system/framework/framework.jar)
05-23 20:14:43.964  3386  4738 E ReflectUtils:  at java.lang.Class.getDeclaredField(Native Method)
05-23 20:14:43.964  3386  4738 E ReflectUtils:  at com.android.systemui.shared.recents.utilities.ReflectUtils.getField(ReflectUtils.java:55)
05-23 20:14:43.964  3386  4738 E ReflectUtils:  at com.android.systemui.shared.recents.utilities.ReflectUtils.getField(ReflectUtils.java:82)
05-23 20:14:43.964  3386  4738 E ReflectUtils:  at com.android.systemui.shared.recents.utilities.ReflectUtils.getObjectField(ReflectUtils.java:69)
05-23 20:14:43.964  3386  4738 E ReflectUtils:  at com.android.systemui.shared.recents.model.RecentsTaskLoadPlan.preloadPlan(RecentsTaskLoadPlan.java:216)
05-23 20:14:43.964  3386  4738 E ReflectUtils:  at com.android.systemui.shared.recents.model.RecentsTaskLoader.preloadTasks(RecentsTaskLoader.java:401)
05-23 20:14:43.964  3386  4738 E ReflectUtils:  at com.miui.home.recents.RecentsModel.preloadRecents(RecentsModel.java:143)
05-23 20:14:43.964  3386  4738 E ReflectUtils:  at com.miui.home.recents.RecentsModel$HandlerCallbacks.handleMessage(RecentsModel.java:236)
05-23 20:14:43.964  3386  4738 E ReflectUtils:  at android.os.Handler.dispatchMessage(Handler.java:102)
05-23 20:14:43.964  3386  4738 E ReflectUtils:  at android.os.Looper.loop(Looper.java:236)
05-23 20:14:43.964  3386  4738 E ReflectUtils:  at android.os.HandlerThread.run(HandlerThread.java:67)
05-23 20:14:44.275 23399 23399 W Looper  : PerfMonitor looperActivity : package=com.android.settings/.AppWidgetPickActivity time=0ms latency=420ms running=0ms  procState=2 ClientTransaction{ callbacks=[android.app.servertransaction.TopResumedActivityChangeItem] } historyMsgCount=1 (msgIndex=1 wall=419ms seq=2751 running=367ms runnable=12ms late=1ms h=android.app.ActivityThread$H w=159)
05-23 20:14:44.276  3386  3386 W RecentsImpl: onResumed className=com.android.settings.AppWidgetPickActivity   mIsInAnotherPro=false   isKeyguardLocked=false
05-23 20:14:44.279 23399 26675 W FA      : Failed to retrieve Firebase Instance Id
05-23 20:14:44.281 23399 23399 E AndroidRuntime: FATAL EXCEPTION: main
05-23 20:14:44.281 23399 23399 E AndroidRuntime: Process: com.android.settings, PID: 23399
05-23 20:14:44.281 23399 23399 E AndroidRuntime: android.view.InflateException: Binary XML file line #17 in com.android.settings:layout/pick_item: Binary XML file line #17 in com.android.settings:layout/pick_item: Error inflating class <unknown>
05-23 20:14:44.281 23399 23399 E AndroidRuntime: Caused by: android.view.InflateException: Binary XML file line #17 in com.android.settings:layout/pick_item: Error inflating class <unknown>
05-23 20:14:44.281 23399 23399 E AndroidRuntime: Caused by: java.lang.reflect.InvocationTargetException
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at java.lang.reflect.Constructor.newInstance0(Native Method)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.view.LayoutInflater.createView(LayoutInflater.java:856)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.view.LayoutInflater.createView(LayoutInflater.java:778)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:58)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.view.LayoutInflater.onCreateView(LayoutInflater.java:932)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.view.LayoutInflater.onCreateView(LayoutInflater.java:952)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:963)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.view.LayoutInflater.inflate(LayoutInflater.java:661)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.view.LayoutInflater.inflate(LayoutInflater.java:536)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at com.android.settings.ActivityPicker$PickAdapter.getView(ActivityPicker.java:316)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.widget.AbsListView.obtainView(AbsListView.java:2419)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.widget.ListView.measureHeightOfChildren(ListView.java:1437)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.widget.ListView.onMeasure(ListView.java:1343)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.view.View.measure(View.java:25835)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7036)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.view.View.measure(View.java:25835)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at com.android.internal.widget.AlertDialogLayout.tryOnMeasure(AlertDialogLayout.java:146)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at com.android.internal.widget.AlertDialogLayout.onMeasure(AlertDialogLayout.java:71)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.view.View.measure(View.java:25835)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7036)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.view.View.measure(View.java:25835)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7036)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.view.View.measure(View.java:25835)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7036)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at com.android.internal.policy.DecorView.onMeasure(DecorView.java:767)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.view.View.measure(View.java:25835)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:3515)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:2308)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2596)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2057)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8362)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1058)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.view.Choreographer.doCallbacks(Choreographer.java:880)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.view.Choreographer.doFrame(Choreographer.java:813)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1043)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:938)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:99)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:236)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:7861)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:600)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
05-23 20:14:44.281 23399 23399 E AndroidRuntime: Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 13: TypedValue{t=0x2/d=0x10010046 a=14}
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.content.res.TypedArray.getDrawableForDensity(TypedArray.java:999)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.content.res.TypedArray.getDrawable(TypedArray.java:983)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.view.View.<init>(View.java:5634)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.widget.TextView.<init>(TextView.java:996)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.widget.TextView.<init>(TextView.java:990)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        at android.widget.TextView.<init>(TextView.java:986)
05-23 20:14:44.281 23399 23399 E AndroidRuntime:        ... 48 more
05-23 20:14:44.289  1788  4710 W ActivityTaskManager:   Force finishing activity com.android.settings/.SubSettings
05-23 20:14:44.292  1788  4710 W ActivityTaskManager:   Force finishing activity com.android.settings/.AppWidgetPickActivity
05-23 20:14:44.299  1788  1972 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.stats.service.DropBoxEntryAddedReceiver
05-23 20:14:44.299  1788  1972 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver
05-23 20:14:44.364  1788  3493 W InputDispatcher: Attempted to unregister already unregistered input channel '9b1c908 com.android.settings/com.android.settings.SubSettings (server)'
05-23 20:14:44.372  1788  4677 W InputDispatcher: Attempted to unregister already unregistered input channel '477323a com.android.settings/com.android.settings.SubSettings (server)'
05-23 20:14:44.379  1788  2262 W InputDispatcher: Attempted to unregister already unregistered input channel '349d037 com.android.settings/com.android.settings.MiuiSettings (server)'
05-23 20:14:44.386  1788  5983 W InputDispatcher: Attempted to unregister already unregistered input channel '3b8bce4 com.android.settings/com.android.settings.AppWidgetPickActivity (server)'
05-23 20:14:44.432  1788  1943 W ActivityManager: setHasOverlayUi called on unknown pid: 23399
05-23 20:14:44.444  7249  7249 W Dock    : Can't load all entries
05-23 20:14:44.447  3386  3386 W RecentsImpl: onResumed className=rocks.tbog.tblauncher.TBLauncherActivity   mIsInAnotherPro=false   isKeyguardLocked=false
05-23 20:14:44.795  1788  1943 W ActivityTaskManager: Activity top resumed state loss timeout for ActivityRecord{cacf87f u0 com.android.settings/.AppWidgetPickActivity t-1 f}}

nv2p avatar May 23 '22 18:05 nv2p

Haven't used your launcher for a while, but passed by and astonished this bug isn't marked as solved. I'm not the author of the issue, but I can confirm that your widget picker is working and so you can close the issue from my point of view.

nv2p avatar Mar 19 '23 09:03 nv2p