pbreault / adb-idea

A plugin for Android Studio and Intellij IDEA that speeds up your day to day android development.
Apache License 2.0
2.12k stars 257 forks source link

Clear App Data doesn't work with the latest Android Studio Canary #137

Closed insiderser closed 2 years ago

insiderser commented 2 years ago

Android Studio Chipmunk | 2021.2.1 Canary 6 Build #AI-212.5457.46.2112.7968471, built on December 4, 2021 Runtime version: 11.0.12+0-b1504.28-7817840 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Linux 5.15.8-227-tkg-bmq GC: G1 Young Generation, G1 Old Generation Memory: 5120M Cores: 12 Registry: external.system.auto.import.disabled=true, editor.show.notification.after.optimize.imports=false, ide.allow.merge.buttons=false, editor.show.notification.after.reformat=false Non-Bundled Plugins: com.github.b3er.idea.plugins.arc.browser (0.23), lermitage.intellij.extra.icons (1.67.0.203), mobi.hsz.idea.gitignore (4.3.0), com.dubreuia (2.3.0), idea.plugin.protoeditor (212.5080.8), String Manipulation (8.23.203.000.0), wu.seal.tool.jsontokotlin (3.7.2), com.developerphil.adbidea (1.6.4), siosio.kodkod (2.0.4) Current Desktop: KDE ADB Idea version: 1.6.4

When pressed "ADB Clear App Data and Restart" for the first time, I got this error:

java.lang.IncompatibleClassChangeError: Method 'com.android.tools.idea.gradle.project.model.AndroidModuleModel com.android.tools.idea.gradle.project.model.AndroidModuleModel.get(org.jetbrains.android.facet.AndroidFacet)' must be InterfaceMethodref constant
    at com.developerphil.adbidea.adb.DeviceResultFetcher.fetch(DeviceResultFetcher.kt:20)
    at com.developerphil.adbidea.adb.AdbFacade.executeOnDevice(AdbFacade.kt:40)
    at com.developerphil.adbidea.adb.AdbFacade.clearDataAndRestart(AdbFacade.kt:25)
    at com.developerphil.adbidea.action.ClearDataAndRestartAction.actionPerformed(ClearDataAndRestartAction.kt:8)
    at com.developerphil.adbidea.action.AdbAction.actionPerformed(AdbAction.kt:9)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performActionDumbAwareWithCallbacks$4(ActionUtil.java:240)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:261)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.java:240)
    at com.intellij.ui.popup.ActionPopupStep.performAction(ActionPopupStep.java:252)
    at com.intellij.ui.popup.ActionPopupStep.performAction(ActionPopupStep.java:242)
    at com.intellij.ui.popup.ActionPopupStep.lambda$onChosen$2(ActionPopupStep.java:228)
    at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:94)
    at com.intellij.ui.popup.AbstractPopup.lambda$dispose$18(AbstractPopup.java:1503)
    at com.intellij.util.ui.EdtInvocationManager.invokeLaterIfNeeded(EdtInvocationManager.java:101)
    at com.intellij.ide.IdeEventQueue.ifFocusEventsInTheQueue(IdeEventQueue.java:186)
    at com.intellij.ide.IdeEventQueue.executeWhenAllFocusEventsLeftTheQueue(IdeEventQueue.java:140)
    at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:175)
    at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.doWhenFocusSettlesDown(IdeFocusManagerImpl.java:36)
    at com.intellij.ui.popup.AbstractPopup.dispose(AbstractPopup.java:1500)
    at com.intellij.ui.popup.WizardPopup.dispose(WizardPopup.java:163)
    at com.intellij.ui.popup.list.ListPopupImpl.dispose(ListPopupImpl.java:337)
    at com.intellij.ui.popup.PopupFactoryImpl$ActionGroupPopup.dispose(PopupFactoryImpl.java:287)
    at com.intellij.openapi.util.ObjectTree.runWithTrace(ObjectTree.java:136)
    at com.intellij.openapi.util.ObjectTree.executeAll(ObjectTree.java:166)
    at com.intellij.openapi.util.Disposer.dispose(Disposer.java:155)
    at com.intellij.openapi.util.Disposer.dispose(Disposer.java:143)
    at com.intellij.ui.popup.WizardPopup.disposeAllParents(WizardPopup.java:266)
    at com.intellij.ui.popup.list.ListPopupImpl.handleNextStep(ListPopupImpl.java:444)
    at com.intellij.ui.popup.list.ListPopupImpl._handleSelect(ListPopupImpl.java:416)
    at com.intellij.ui.popup.list.ListPopupImpl.handleSelect(ListPopupImpl.java:372)
    at com.intellij.ui.popup.PopupFactoryImpl$ActionGroupPopup.handleSelect(PopupFactoryImpl.java:304)
    at com.intellij.ui.popup.list.ListPopupImpl$MyMouseListener.mouseReleased(ListPopupImpl.java:629)
    at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:298)
    at java.desktop/java.awt.Component.processMouseEvent(Component.java:6652)
    at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3345)
    at com.intellij.ui.popup.list.ListPopupImpl$MyList.processMouseEvent(ListPopupImpl.java:706)
    at java.desktop/java.awt.Component.processEvent(Component.java:6417)
    at java.desktop/java.awt.Container.processEvent(Container.java:2263)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859)
    at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
    at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
    at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
    at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2784)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:885)
    at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:814)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:751)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:441)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:825)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:440)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:794)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:492)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

The data wasn't actually cleared, and the app wasn't restarted.

When I press "ADB Clear App Data and Restart" after that, nothing happens. No errors, data not cleared, app not restarted.

Not happened with Canary 5

eygraber commented 2 years ago

Also happens on Canary 6, and with all the actions, not just clear data and restart.

eygraber commented 2 years ago

I built the plugin from source and it works. Maybe the issue is that it needs to be built with JDK 11?

Here's the plugin in case anyone wants to install locally - adb_idea-1.7.0-SNAPSHOT.zip

raghavsatyadev commented 2 years ago

Thanks for this versions @eygraber , it actually works

insiderser commented 2 years ago

Sorry, I've switched to the stable version of Android Studio since this issue was created, so I'm not able to confirm whether plugin works or not with Android Studio Chipmunk anymore.

eygraber commented 2 years ago

@pbreault any ideas on this?

eygraber commented 2 years ago

Looks like this was handled in other plugins by building with Java 11 - https://github.com/cashapp/sqldelight/pull/3194

raghavsatyadev commented 2 years ago

this is solved in new 1.6.5 version

insiderser commented 2 years ago

I can confirm it's possible to clear app data now on Android Studio Dolphin | 2021.3.1 Beta 1.

ADB IDEA version: 1.6.6