Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 345
Ido Wolf Avatar asked Jun 12 '18 09:06

Ido Wolf


People also ask

How to enable advanced profiling Android Studio?

Select Run > Edit Configurations. Select your app module in the left pane. Click the Profiling tab, and then check Enable additional support for older devices (API level < 26). Build and run your app again.

How to open network Profiler in Android Studio?

To open the Network Inspector, follow these steps: From the Android Studio navigation bar, select View > Tool Windows > App Inspection. After the app inspection window automatically connects to an app process, select Network Inspector from the tabs.

What is native in Android Profiler?

The Native Memory Profiler tracks allocations/deallocations of objects in native code for a specific time period and provides the following information: Allocations: A count of objects allocated via malloc() or the new operator during the selected time period.


3 Answers

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.

like image 55
Marco Avatar answered Oct 17 '22 05:10

Marco


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.

like image 6
user1506104 Avatar answered Oct 17 '22 06:10

user1506104


Had the same problem with my phone Android api level 28: "Android Profiling is unavailable for the selected process".

Solution 1.

The following steps helped me temporarely - then after rebuild the problem appeared again:

  1. clean the project
  2. Removed .idea folder
  3. Restarted the project
  4. Now profiler works ,e.g., I can select Network Profiler range

Solution 2.

Use emulator api level 29. Advanced profiling always works fine for me there.

What didn't help me:

  • debuggable true (already was)
  • Edit Configuration > Profiling > enable .. (already was)

And such Android Studio tricks drive me crazy.

like image 3
Andrew Avatar answered Oct 17 '22 07:10

Andrew