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 .

Mitesh Vanaliya
  • 2,491
  • 24
  • 39

2 Answers2

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.

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.

Jyubin Patel
  • 1,373
  • 7
  • 17
  • Please check your device/emulator is listed into spinner view or not. – Jyubin Patel Jan 16 '18 at 09:24
  • yes device listed and also select my package in next spinner – Mitesh Vanaliya Jan 16 '18 at 09:37
  • Please reset your adb once and check again. – Jyubin Patel Jan 16 '18 at 09:50
  • 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) – Ajit Sharma Mar 23 '18 at 11:35