0

I just installed Android Studio and have started a new app (Basic App template with toolbar and floating button). I have enabled Virtualization in my BIOS and have added a Pixel 2 (version 29) emulator.

When I press the Run button, the emulator opens the Pixel 2 and powers on, but the app doesn't open and no icons appear (apart from the standard phone, sms, chrome, playstore icons). I press Run again and still nothing happens (apart from Gradle building).

There are no errors that I can see.

Edit: Every now and then when I press Run I see the following error message in Event Log:

8:52 AM Error during Sync: Remote object doesn't exist!

This only occurs sometimes. Other time, it just says:

8:44 AM Executing tasks: [:app:assembleDebug]

8:44 AM Gradle build finished in 3 s 972 ms

I have tried:

  • Deleting the emulator from AVD Manager then creating a new one (Pixel 2, version 29, everything else left as default).
  • Deleting the project and creating a new one
  • Uninstalling and reinstalling Android Studio
  • Restarting computer
  • Going to File > Invalidate Caches / Restart and invaliding then restarting

Edit 2:

I was just asked to check Logcat in a comment. There is a lot in there but this part is highlighted red and repeats throughout the logs:

2019-08-02 08:53:21.707 2031-9184/? E/LoadManifestTask: Can't find Chimera operation impl class com.google.android.gms.walletp2p.infra.phenotype.PhenotypeCommitIntentOperation dropping operation
    java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.walletp2p.infra.phenotype.PhenotypeCommitIntentOperation" on path: DexPathList[[zip file "/system/product/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk"],nativeLibraryDirectories=[/data/user_de/0/com.google.android.gms/app_extracted_libs/x86, /system/product/priv-app/PrebuiltGmsCore/lib/x86, /system/product/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk!/lib/x86, /system/lib, /system/product/lib, /system/lib, /system/product/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at ecj.<init>(:com.google.android.gms@16910022@16.9.10 (040700-247503114):5)
        at eck.run(:com.google.android.gms@16910022@16.9.10 (040700-247503114):53)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)
Jake
  • 3,865
  • 5
  • 25
  • 58
  • And when you check via 'Logcat' either by `adb` or the tab in the lower left of Android Studio you see misc log data? – Morrison Chang Aug 02 '19 at 01:57
  • Post updated with Logcat info. Thanks, I wasn't aware of that. First day using Android Studio (not off to a good start haha). – Jake Aug 02 '19 at 02:00
  • I would recommend using API 28 Pie as your emulator for now as the API 29 Q is still in beta. Also identify what PC you have (CPU/memory/OS version/etc.) in case others may have encountered your issue. – Morrison Chang Aug 02 '19 at 02:05
  • That didn't work either. Now event logs say: `9:28 AM Emulator: Critical: UpdateLayeredWindowIndirect failed for ptDst=(167, 138), size=(375x21), dirty=(375x21 0, 0) (A device attached to the system is not functioning.) ((null):0, (null))` – Jake Aug 02 '19 at 02:33
  • Strange, I would add in details of your PC including what GPU and if you are using multiple monitors. On everything up to date Macbook Air I was able to run an app with a newly created emulator (although it did have a number of Error messages in the log and I had to disable Instant Run for API 28). – Morrison Chang Aug 02 '19 at 02:38

1 Answers1

0

This is a very undesirable kind of system bug. Well, the point is here that, sometimes even creating a simple data directory won't work. You would have to go to the source and create a folder yourself. This case is same. Attempting 'Invalidate caches and restating' isn't working, so you have to do it manually. This is how:

Solution:

Close Android Studio

Go to C:\Users\UserName\.android and rename:

  • build-cache folder to build-cache.bak

Go to C:\Users\UserName\.AndroidStudio3.4.2\system and rename these folders:

  • caches to caches.bak

  • compiler to compiler.bak

  • compile-server to compile-server.bak

  • conversion to conversion.bak

  • external_build_system to external_build_system.bak

  • frameworks to frameworks.bak

  • gradle to gradle.bak

  • resource_folder_cache to resource_folder_cache.bak

Open the Android Studio and open your project again.

Hope it solves your case also. Did for me when I faced the same problem around a year ago.

Farhan Ibn Wahid
  • 926
  • 1
  • 9
  • 22
  • I wasn't able to test this as I decided to instead completely uninstall Android Studio (following this guide - https://stackoverflow.com/a/39953746/7040366) then reinstalled while ticking a lot more boxes in the SDK. It's working now. – Jake Aug 02 '19 at 05:38