Fixed
Status Update
Comments
da...@google.com <da...@google.com> #3
Thank you for reporting this issue. For us to further investigate this issue, please provide the following additional information:
Android build
Which Android build are you using? (e.g. OPP1.170223.012)
Device used
Which device did you use to reproduce this issue?
Steps to reproduce
What steps are needed to reproduce this issue?
Frequency
How frequently does this issue occur? (e.g 100% of the time, 10% of the time)
Android bug report (to be captured after reproducing the issue)
For steps to capture a bug report, please refer:https://developer.android.com/studio/debug/bug-report#bugreportdevice
Alternate method
Navigate to “Developer options”, ensure “USB debugging” is enabled, then enable “Bug report shortcut”. Capture bug report by holding the power button and selecting the “Take bug report” option.
Screen capture of the issue
Press the volume down and power buttons simultaneously. The image will appear in your gallery. Attach the screenshot file to this issue.
Note: Please upload the files to google drive and share the folder to android-bugreport@google.com, then share the link here.
Android build
Which Android build are you using? (e.g. OPP1.170223.012)
Device used
Which device did you use to reproduce this issue?
Steps to reproduce
What steps are needed to reproduce this issue?
Frequency
How frequently does this issue occur? (e.g 100% of the time, 10% of the time)
Android bug report (to be captured after reproducing the issue)
For steps to capture a bug report, please refer:
Alternate method
Navigate to “Developer options”, ensure “USB debugging” is enabled, then enable “Bug report shortcut”. Capture bug report by holding the power button and selecting the “Take bug report” option.
Screen capture of the issue
Press the volume down and power buttons simultaneously. The image will appear in your gallery. Attach the screenshot file to this issue.
Note: Please upload the files to google drive and share the folder to android-bugreport@google.com, then share the link here.
da...@google.com <da...@google.com> #4
Please share the details requested in comment #3 , to proceed further with the bug.
da...@google.com <da...@google.com>
da...@google.com <da...@google.com> #5
Android build:
Happened on every Android version I tested this, i.e. API 21 to API 29
Device used:
Pixel 2 XL as well as several emulated devices in Android Studio
Steps to reproduce:
See original post
Frequency:
Always, i.e. 100%
Android bug report:
N.A.
Screen capture of the issue
N.A.
Happened on every Android version I tested this, i.e. API 21 to API 29
Device used:
Pixel 2 XL as well as several emulated devices in Android Studio
Steps to reproduce:
See original post
Frequency:
Always, i.e. 100%
Android bug report:
N.A.
Screen capture of the issue
N.A.
si...@gmail.com <si...@gmail.com> #6
Facing the same problem. UsageStatsManager.queryUsageStats seems to return unpredictable results. I will post more details later.
da...@google.com <da...@google.com> #7
Please provide sample project or apk to reproduce the issue. Also mention the steps to be followed for reproducing the issue with the given sample project or apk.
da...@google.com <da...@google.com> #8
Please share the apk requested in comment #7 , to proceed further with the bug.
da...@google.com <da...@google.com> #9
I created this issue more than a year ago. Back then I did solve this by some workaround / own method. Of course I am now working on something else and cannot develop and provide an extra app for you.
Also please note that this is in fact not anything app-specific but rather a general problem with the Android API (e.g. you might have a look at the multiple threads regardings this onstackoverflow.com ).
Also please note that this is in fact not anything app-specific but rather a general problem with the Android API (e.g. you might have a look at the multiple threads regardings this on
si...@gmail.com <si...@gmail.com> #10
@ <be...@googlemail.com> in comment #9
Are you using **UsageStatsManager.queryEvents** instead of **queryUsageStats** in your workaround / own method?
**queryEvents** is more precise, however, I have to filter the query result and do lots of computation to get the app usage information.
It's some workaround but not a user-friendly solution.
Are you using **UsageStatsManager.queryEvents** instead of **queryUsageStats** in your workaround / own method?
**queryEvents** is more precise, however, I have to filter the query result and do lots of computation to get the app usage information.
It's some workaround but not a user-friendly solution.
Description
In the attached project, note the stub_test.xml layout file
Open the Test.kt class and notice the missing Context import and that Context is highlight red
Place the cursor on Context and hit option-enter. Notice that an import doesn't get added for Context. After some time, or pressing it a few times, notice the IDE error.
Delete the stub_test.xml or add viewBindingIgnore="true" to it and notice that an import gets added for Context right away
Android Studio 3.6 beta1
java.lang.IllegalStateException: field must not be null
at com.android.tools.idea.databinding.cache.LayoutBindingShortNamesCache$3.compute(LayoutBindingShortNamesCache.kt:78)
at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:54)
at com.intellij.util.CachedValueBase.lambda$getValueWithLock$1(CachedValueBase.java:240)
at com.intellij.openapi.util.RecursionManager$1.doPreventingRecursion(RecursionManager.java:113)
at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:71)
at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:241)
at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:43)
at com.android.tools.idea.databinding.cache.LayoutBindingShortNamesCache.getFieldsByName(LayoutBindingShortNamesCache.kt:132)
at com.intellij.psi.search.PsiShortNamesCache.processFieldsWithName(PsiShortNamesCache.java:185)
at com.intellij.psi.impl.CompositeShortNamesCache.processFieldsWithName(CompositeShortNamesCache.java:238)
at org.jetbrains.kotlin.idea.core.KotlinIndicesHelper.getFieldsByNameUnfiltered(KotlinIndicesHelper.kt:355)
at org.jetbrains.kotlin.idea.core.KotlinIndicesHelper.getJavaCallables(KotlinIndicesHelper.kt:334)
at org.jetbrains.kotlin.idea.core.KotlinIndicesHelper.processJvmCallablesByName(KotlinIndicesHelper.kt:277)
at org.jetbrains.kotlin.idea.quickfix.ImportFix.collectMemberCandidates(ImportFix.kt:338)
at org.jetbrains.kotlin.idea.quickfix.ImportFix.fillCandidates(ImportFix.kt:368)
at org.jetbrains.kotlin.idea.quickfix.ImportFixBase.collectSuggestionsForName(ImportFix.kt:179)
at org.jetbrains.kotlin.idea.quickfix.ImportFixBase.collectSuggestions(ImportFix.kt:147)
at org.jetbrains.kotlin.idea.quickfix.KotlinReferenceImporter$Companion.autoImport(KotlinReferenceImporter.kt:117)
at org.jetbrains.kotlin.idea.quickfix.KotlinReferenceImporter$Companion.autoImportReferenceAtCursor(KotlinReferenceImporter.kt:95)
at org.jetbrains.kotlin.idea.quickfix.KotlinReferenceImporter.autoImportReferenceAtCursor(KotlinReferenceImporter.kt:43)
at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl.autoImportReferenceAtCursor(DaemonCodeAnalyzerImpl.java:864)
at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.lambda$letAutoImportComplete$1(ShowIntentionActionsHandler.java:104)
at com.intellij.openapi.command.impl.CoreCommandProcessor.runUndoTransparentAction(CoreCommandProcessor.java:377)
at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.letAutoImportComplete(ShowIntentionActionsHandler.java:104)
at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.invoke(ShowIntentionActionsHandler.java:71)
at com.intellij.codeInsight.intention.actions.ShowIntentionActionsAction.actionPerformed(ShowIntentionActionsAction.java:50)
at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:265)
at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:82)
at com.intellij.openapi.application.TransactionGuardImpl.submitTransactionAndWait(TransactionGuardImpl.java:148)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:280)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$1.performAction(IdeKeyEventDispatcher.java:593)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.lambda$processAction$3(IdeKeyEventDispatcher.java:646)
at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:192)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:645)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processActionOrWaitSecondStroke(IdeKeyEventDispatcher.java:508)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.inInitState(IdeKeyEventDispatcher.java:463)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:212)
at com.intellij.ide.IdeEventQueue.lambda$new$5(IdeEventQueue.java:265)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:805)
at com.intellij.ide.IdeKeyboardFocusManager.dispatchEvent(IdeKeyboardFocusManager.java:40)
at java.awt.Component.dispatchEventImpl(Component.java:4770)
at java.awt.Container.dispatchEventImpl(Container.java:2297)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4721)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:766)
at java.awt.EventQueue.access$500(EventQueue.java:98)
at java.awt.EventQueue$3.run(EventQueue.java:715)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
at java.awt.EventQueue$4.run(EventQueue.java:739)
at java.awt.EventQueue$4.run(EventQueue.java:737)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:736)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:878)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:805)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:466)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:704)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:465)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)