Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Profiling failed in Android Studio 3.3

I just updated Android Studio 3.2 to 3.3. It updated the Gradle plugin in my project from 3.2.1 to 3.3. Now enabling advanced profiling in Run/Debug configuration making my app crash. Clean/Rebuild/Invalidate caches don't help.

I found one way to make it work: rolling plugin back to 3.2.1 (in project build.gradle)

dependencies {
    classpath 'com.android.tools.build:gradle:3.2.1'
}

Is there any other way?

01-15 13:38:31.527 6969-6969/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.appcard.androidterminal, PID: 6969
    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/android/tools/profiler/support/ProfilerService;
        at com.appcard.androidterminal.AppContext.<init>(AppContext.java:53)
        at java.lang.reflect.Constructor.newInstance(Native Method)
        at java.lang.Class.newInstance(Class.java:1606)
        at android.app.Instrumentation.newApplication(Instrumentation.java:1000)
        at android.app.Instrumentation.newApplication(Instrumentation.java:985)
        at android.app.LoadedApk.makeApplication(LoadedApk.java:567)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4837)
        at android.app.ActivityThread.access$1500(ActivityThread.java:178)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1531)
        at android.os.Handler.dispatchMessage(Handler.java:111)
        at android.os.Looper.loop(Looper.java:194)
        at android.app.ActivityThread.main(ActivityThread.java:5643)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.android.tools.profiler.support.ProfilerService" on path: DexPathList[[zip file "/data/app/com.appcard.androidterminal-1/base.apk"],nativeLibraryDirectories=[/data/app/com.appcard.androidterminal-1/lib/arm, /vendor/lib, /system/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
        at com.appcard.androidterminal.AppContext.<init>(AppContext.java:53) 
        at java.lang.reflect.Constructor.newInstance(Native Method) 
        at java.lang.Class.newInstance(Class.java:1606) 
        at android.app.Instrumentation.newApplication(Instrumentation.java:1000) 
        at android.app.Instrumentation.newApplication(Instrumentation.java:985) 
        at android.app.LoadedApk.makeApplication(LoadedApk.java:567) 
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4837) 
        at android.app.ActivityThread.access$1500(ActivityThread.java:178) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1531) 
        at android.os.Handler.dispatchMessage(Handler.java:111) 
        at android.os.Looper.loop(Looper.java:194) 
        at android.app.ActivityThread.main(ActivityThread.java:5643) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at java.lang.reflect.Method.invoke(Method.java:372) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755) 
        Suppressed: java.lang.ClassNotFoundException: com.android.tools.profiler.support.ProfilerService
        at java.lang.Class.classForName(Native Method)
        at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
        at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
                ... 17 more
     Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
like image 418
Andrey Rankov Avatar asked Jan 15 '19 12:01

Andrey Rankov


1 Answers

I filled a bug, here is Google dev response:

I was able to reproduce the issue with emulator API 25 and lower. Workaround is to use device/emulator API of 26 or higher.

https://issuetracker.google.com/issues/122944954#comment4

Update:

Yes, this has been fixed. The fix won't be in 3.3.1, but it will be in the following release.

like image 67
Andrey Rankov Avatar answered Oct 19 '22 00:10

Andrey Rankov