Android studio 3.0: Studio Profilers encountered an unexpected error
Asked Answered
G

2

14

My application runs perfectly.

But my logcat give an error every time when I run my application:

12-11 20:45:42.539 946-1547/package E/StudioProfiler: Studio Profilers encountered an unexpected error. Consider reporting a bug, including logcat output below.

See also: https://developer.android.com/studio/report-bugs.html#studio-bugs

Failed to capture application

What's this error means?

Why it's occurred every time?

I am using Android studio 3.0.1 and Gradle 3.0.1 .

Geopolitics answered 14/12, 2017 at 7:10 Comment(0)
C
1

However, not all profiling data is visible by default. If you see a message that says, "Advanced profiling is unavailable for the selected process," you need to enable advanced profiling in your run configuration:

  1. Select Run > Edit Configurations.
  2. Select your app module in the left pane.
  3. Click the Profiling tab, and then check Enable advanced profiling.

Reason:

I thing when you disable the option your Garbage collection events in Memory Profiler are cleared and then when you run build it works perfectly.

Cyanate answered 10/1, 2018 at 20:21 Comment(3)
When I disable this option! it's working fine. But I am not found any reason. Any idea about this?Geopolitics
@MiteshVanaliya sorry for late reply see my updated answer :)Cyanate
Okay great!! As per your answer issue is not garbage events from Memory Profiler, Right?Geopolitics
C
0

Please check in logcat below things but before that you can see this first:

Try to Enable advanced profiling:

Select Run > Edit Configurations.

Select your app module in the left pane.

Click the Profiling tab, and then check Enable advanced profiling.

1) Please select your mobile device/emulator first on which you run your application( In your first spinner view).

2) Please select your application package which you run in mobile/emulator in second spinner view.

3) And Third options has some pre-defined tag like verbose,debug,info,error and so on.Please select verbose so you can see each and every log of your applications.

If above thing is not useful then please restart your studio once or invalidate caches and restart to check once again above all option revise.

And Please check below is not written into progard config for Android:

-dontskipnonpubliclibraryclasses
-dontobfuscate
-forceprocessing
-optimizationpasses 5

-keep class * extends android.app.Activity
-assumenosideeffects class android.util.Log {
    public static *** d(...);
    public static *** v(...);
}

Hope it helps you and solved your problem.

Construction answered 16/1, 2018 at 5:8 Comment(4)
Please check your device/emulator is listed into spinner view or not.Construction
yes device listed and also select my package in next spinnerGeopolitics
Please reset your adb once and check again.Construction
I know this is a bit late but Adding one more Comment just for help, If someone is working with database and getting the count of rows with readabledatabase.close(). This will throw the same error. Try to remore code which is closing database connecion in start. This is how i solved error in my project. I was working with Studio Build: 3.0.1 Version of Gradle Plugin: 3.0.1 Version of Gradle: 4.1 Version of Java: 1.8.0_151 OS: Windows 7.1 (64 bit)Berky

© 2022 - 2024 — McMap. All rights reserved.