Status Update
Comments
vi...@google.com <vi...@google.com>
ph...@google.com <ph...@google.com>
yi...@google.com <yi...@google.com> #2
ps...@google.com <ps...@google.com> #3
the trace file is copied from device to host machine but immediately deleted
This happens because the file is opened and immediately closed in the editor. Files downloaded from the device explorer and opened in the editor are automatically deleted once the editor tab is closed.
Correct me if I'm wrong, but I think we don't want dmtrace.trace
files to be opened in the editor, but only in profilers. To do this we could make AndroidProfilerCaptureFileType
extend from INativeFileType
, which has a openFileInAssociatedApplication
method, from which we can explicitly tell IJ what to do when the file is opened.
The problem with doing this is that then profilers would have to handle file deletion once the file is not needed anymore. (files downloaded from the device explorer are downloaded in a temporary location, from which should be deleted once they're not needed anymore)
yi...@google.com <yi...@google.com> #4
to...@gmail.com <to...@gmail.com> #5
It displays this error
Error opening contents of device file "dmtrace.trace": Cannot delete 'C:\Users\tomas\Documents\AndroidStudio\DeviceExplorer\samsung-sm_g955f-ce041714f496c83803\sdcard\Android\data\androidx.test.myapplicationkotlin\files\dmtrace.trace'
It maybe keeps this file open, even after it is loaded inside of the profiler.
I tried also to delete the session with this file, but it doesn't help.
ps...@google.com <ps...@google.com> #6
Yi, when a file is downloaded, Device Explorer first tries to delete a local copy of it (if it exists). I think what's happening is that a file is downloaded twice (or a file with the same name maybe) and when Device Explorer tires to delete the first copy of the file, it can't because it's open.
Should we close files after the profilers tool window is ready?
yi...@google.com <yi...@google.com> #7
Can you share your idea.log (Help -> Show Logs in Finder/Explorer) here and I may know what the bug is.
si...@gmail.com <si...@gmail.com> #8
1429992
to...@gmail.com <to...@gmail.com> #9
si...@gmail.com <si...@gmail.com> #10
bug
yi...@google.com <yi...@google.com> #11
Thanks for providing the logs. As I suspected, it's actually another bug related to using profilers across multiple project instances:
java.lang.AssertionError
at com.android.tools.profilers.cpu.CpuProfiler.run(CpuProfiler.java:85)
at com.android.tools.profilers.StudioProfilers.selectedSessionChanged(StudioProfilers.java:667)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at com.android.tools.adtui.model.AspectModel$Dependency.changed(AspectModel.java:81)
at com.android.tools.adtui.model.AspectModel$Dependency.access$100(AspectModel.java:66)
at com.android.tools.adtui.model.AspectModel.lambda$changed$0(AspectModel.java:31)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at com.android.tools.adtui.model.AspectModel.changed(AspectModel.java:31)
at com.android.tools.profilers.sessions.SessionsManager.setSessionInternal(SessionsManager.java:372)
at com.android.tools.profilers.sessions.SessionsManager.lambda$updateSessionItemsByGroup$3(SessionsManager.java:279)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at com.android.tools.profilers.sessions.SessionsManager.updateSessionItemsByGroup(SessionsManager.java:255)
at com.android.tools.profilers.sessions.SessionsManager.updateSessions(SessionsManager.java:235)
at com.android.tools.profilers.sessions.SessionsManager.update(SessionsManager.java:222)
at com.android.tools.profilers.StudioProfilers.update(StudioProfilers.java:507)
at com.android.tools.adtui.model.updater.Updater.lambda$onTick$0(Updater.java:103)
I'm actually working a fix that should address this issue. Stay tuned.
Description
Debug.startMethodTracing()
Debug.stopMethodTracing()
to create dmtrace.trace file and double click on it in Device File Manager.
It looks that it trying to open it, it downloads it, Profiles windows is open, in loading state, but it is never loaded.
When I download it manually and then open it, it works.
Build: AI-201.8743.12.41.6953283, 202011050241,
AI-201.8743.12.41.6953283, JRE 1.8.0_212-release-1586-b04x64 JetBrains s.r.o, OS Windows 10(amd64) v10.0 , screens 2560x1440, 2560x1440
AS: 4.1.1; Kotlin plugin: 1.4.20-release-Studio4.1-1; Android Gradle Plugin: 4.1.1; Gradle: 6.9; NDK: from local.properties: (not specified), latest from SDK: (not found); LLDB: pinned revision 3.1 not found, latest from SDK: (package not found); CMake: from local.properties: (not specified), latest from SDK: (not found), from PATH: (not found)
IMPORTANT: Please read