问题
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:
- Enable Advanced Profiling (obviously) for the app as well as the default Run Configurations
- Disable ProGuard in all modules using minifyEnabled false
- Update Studio version to 3.1.3 and Gradle to 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