Profiling failed in Android Studio 3.3
Asked Answered
B

1

8

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
Binoculars answered 15/1, 2019 at 12:12 Comment(3)
thank you. I disabled this feature "adv. profiling" and can finally work again. Google being Google againGrotesque
thanks, i downgraded gradle 3.3 to 3.2.1 for adv. profilingColtun
Thanks. This helped me too. They 'strong recommend' to update to gradle 3.3 but it does end up on this issue, maybe a missing configuration.Styles
B
3

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.

Binoculars answered 4/2, 2019 at 8:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.