Android Profiling is unavailable for the selected process, but advanced profiling is enabled

℡╲_俬逩灬. 提交于 2020-06-25 10:57:21

问题


I am developing an Android app with multiple modules. The app uses ProGuard, compileSdkVersion is set to 27 in all modules, and when I tried to enable Advanced Profiling I continue to get a message saying "Advanced profiling is unavailable for the selected process".

Solutions I've tried after searching other questions about the topic:

  1. Enable Advanced Profiling (obviously) for the app as well as the default Run Configurations
  2. Disable ProGuard in all modules using minifyEnabled false
  3. Update Studio version to 3.1.3 and Gradle to 4.4
  4. Rebuild project after the above changes

Am I missing something? Is there anything else I can do to enable Advanced Profiling?


回答1:


I had the same problem and the solution was easy, in my case: set debuggable true in file build.gradle for the selected Build Variant.




回答2:


If you are running API level < 26, enable the Profiler in Run -> Edit Configurations. From the list, choose your module. On the right hand side of the window, click Profiling. Enable the checkbox Enable advanced profiling.




回答3:


In your build.gradle file turn on debuggable flag (debuggable true).

For eg :

buildTypes {
        debug {
            debuggable true
            buildConfigField "Boolean", "DEBUG_MODE", "true"
        }
    }


来源:https://stackoverflow.com/questions/50813715/android-profiling-is-unavailable-for-the-selected-process-but-advanced-profilin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!