Android Studio emulator will not run a simple Hell

2019-06-25 13:54发布

问题:

I am unable to run a simple hello world app in Android Studio(2.1.2). It will load the emulator, and I will just get a black screen with the android graphic on it, like the phone is being turned on.

I've been dealing with these issues for a little bit, google'd a ton, screwed with a bunch of settings, then decided I should completely uninstall Android Studio using the steps in this: How to completely uninstall Android Studio? and reinstall starting from scratch.

So I uninstalled, then reinstalled Android Studio, started the application, downloaded the recommended SDK's and all that, and created a new Android Studio Project with an empty activity. After that, I didnt add or take away any code, I just created a new emulator and ran the app on it. And, of course, this didnt solve my problem

I receive the following errors in logcat while "Waiting for target device to come online..." :

07-22 03:15:07.923 1204-1204/? E/perfprofd: unable to open configuration file /data/data/com.google.android.gms/files/perfprofd.conf
07-22 03:15:10.761 1182-1182/? E/libEGL: load_driver(/system/lib/egl/libGLES_emulation.so): dlopen failed: library "/system/lib/egl/libGLES_emulation    .so" not found
07-22 03:15:12.404 1182-1182/? E/SurfaceFlinger: hwcomposer module not found
07-22 03:15:12.943 1182-1182/? E/cutils-trace: Error opening trace file: Permission denied (13)
07-22 03:15:19.288 1182-1256/? E/SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
07-22 03:15:19.789 1274-1288/? E/libEGL: load_driver(/system/lib/egl/libGLES_emulation.so): dlopen failed: library "/system/lib/egl/libGLES_emulation    .so" not found
07-22 03:15:21.284 1274-1288/? E/cutils-trace: Error opening trace file: Permission denied (13)

                                               [ 07-22 03:15:21.293  1182: 1256 D/         ]
                                               HostConnection::get() New Host Connection established 0xb6cc7060, tid 1256


                                               [ 07-22 03:15:22.338  1182: 1260 D/         ]
                                               HostConnection::get() New Host Connection established 0xb70102c0, tid 1260
07-22 03:15:25.146 1199-1199/? E/cutils-trace: Error opening trace file: Permission denied (13)
07-22 03:15:25.146 1199-1199/? E/CameraService: setUpVendorTags: Vendor tag operations not fully defined. Ignoring definitions.
07-22 03:15:31.412 1199-1356/? E/AudioFlinger: no wake lock to update!
07-22 03:15:31.843 1199-1199/? E/audio_hw_generic: Error opening input stream format 1, channel_mask 0010, sample_rate 16000
07-22 03:15:31.868 1199-1199/? E/AudioFlinger: int android::load_audio_interface(const char*, audio_hw_device_t**) couldn't load audio hw module     audio.r_submix (No such file or directory)
07-22 03:15:31.974 1199-1199/? E/SoundTriggerHwService: couldn't load sound trigger module sound_trigger.primary (No such file or directory)
07-22 03:15:31.978 1199-1199/? E/RadioService: couldn't load radio module radio.primary (No such file or directory)
07-22 03:15:51.646 1202-1202/? E/memtrack: Couldn't load memtrack module (No such file or directory)
07-22 03:15:51.646 1202-1202/? E/android.os.Debug: failed to load memtrack module: -2
07-22 03:15:56.900 1190-1190/? E/Netd: exec() res=0, status=768 for /system/bin/iptables -w -t nat -N oem_nat_pre 
07-22 03:15:57.137 1190-1190/? E/Netd: exec() res=0, status=768 for /system/bin/iptables -w -t nat -A PREROUTING -j oem_nat_pre 
07-22 03:15:58.435 1190-1190/? E/Netd: exec() res=0, status=768 for /system/bin/iptables -w -t nat -N natctrl_nat_POSTROUTING 
07-22 03:15:59.159 1190-1190/? E/Netd: exec() res=0, status=768 for /system/bin/iptables -w -t nat -A POSTROUTING -j natctrl_nat_POSTROUTING 
07-22 03:16:06.300 1202-1202/? E/Minikin: addFont failed to create font /system/fonts/NanumGothic.ttf
07-22 03:16:06.300 1202-1202/? E/Minikin: addFont failed to create font /system/fonts/DroidSansFallback.ttf
07-22 03:16:06.301 1202-1202/? E/Minikin: addFont failed to create font /system/fonts/MTLmr3m.ttf
07-22 03:16:26.806 1190-1190/? E/Netd: cannot find interface dummy0
07-22 03:16:27.957 1202-1202/? E/EmojiFactory_jni: Failed to load libemoji.so: dlopen failed: library "libemoji.so" not found
07-22 03:17:49.792 1202-1202/? E/libEGL: load_driver(/system/lib/egl/libGLES_emulation.so): dlopen failed: library "/system/lib/egl/libGLES_emulation    .so" not found
07-22 03:17:50.616 1202-1202/? E/Hyphenator: error loading hyphenation /system/usr/hyphen-data/hyph-en-us.pat.txt
                                             java.io.FileNotFoundException: /system/usr/hyphen-data/hyph-en-us.pat.txt: open failed: ENOENT (No such     file or directory)
                                                 at libcore.io.IoBridge.open(IoBridge.java:452)
                                                 at libcore.io.IoUtils$FileReader.<init>(IoUtils.java:207)
                                                 at libcore.io.IoUtils.readFileAsString(IoUtils.java:114)
                                                 at android.text.Hyphenator.loadHyphenator(Hyphenator.java:96)
                                                 at android.text.Hyphenator.init(Hyphenator.java:154)
                                                 at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:207)
                                                 at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:186)
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
                                              Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
                                                 at libcore.io.Posix.open(Native Method)
                                                 at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
                                                 at libcore.io.IoBridge.open(IoBridge.java:438)
                                                 at libcore.io.IoUtils$FileReader.<init>(IoUtils.java:207) 
                                                 at libcore.io.IoUtils.readFileAsString(IoUtils.java:114) 
                                                 at android.text.Hyphenator.loadHyphenator(Hyphenator.java:96) 
                                                 at android.text.Hyphenator.init(Hyphenator.java:154) 
                                                 at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:207) 
                                                 at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:186) 
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593) 
07-22 03:17:50.652 1202-1202/? E/Hyphenator: error loading hyphenation /system/usr/hyphen-data/hyph-eu.pat.txt
                                             java.io.FileNotFoundException: /system/usr/hyphen-data/hyph-eu.pat.txt: open failed: ENOENT (No such     file or directory)
                                                 at libcore.io.IoBridge.open(IoBridge.java:452)
                                                 at libcore.io.IoUtils$FileReader.<init>(IoUtils.java:207)
                                                 at libcore.io.IoUtils.readFileAsString(IoUtils.java:114)
                                                 at android.text.Hyphenator.loadHyphenator(Hyphenator.java:96)
                                                 at android.text.Hyphenator.init(Hyphenator.java:154)
                                                 at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:207)
                                                 at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:186)
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
                                              Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
                                                 at libcore.io.Posix.open(Native Method)
                                                 at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
                                                 at libcore.io.IoBridge.open(IoBridge.java:438)
                                                 at libcore.io.IoUtils$FileReader.<init>(IoUtils.java:207) 
                                                 at libcore.io.IoUtils.readFileAsString(IoUtils.java:114) 
                                                 at android.text.Hyphenator.loadHyphenator(Hyphenator.java:96) 
                                                 at android.text.Hyphenator.init(Hyphenator.java:154) 
                                                 at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:207) 
                                                 at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:186) 
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593) 
07-22 03:17:50.665 1202-1202/? E/Hyphenator: error loading hyphenation /system/usr/hyphen-data/hyph-hu.pat.txt
                                             java.io.FileNotFoundException: /system/usr/hyphen-data/hyph-hu.pat.txt: open failed: ENOENT (No such     file or directory)
                                                 at libcore.io.IoBridge.open(IoBridge.java:452)
                                                 at libcore.io.IoUtils$FileReader.<init>(IoUtils.java:207)
                                                 at libcore.io.IoUtils.readFileAsString(IoUtils.java:114)
                                                 at android.text.Hyphenator.loadHyphenator(Hyphenator.java:96)
                                                 at android.text.Hyphenator.init(Hyphenator.java:154)
                                                 at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:207)
                                                 at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:186)
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
                                              Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
                                                 at libcore.io.Posix.open(Native Method)
                                                 at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
                                                 at libcore.io.IoBridge.open(IoBridge.java:438)
                                                 at libcore.io.IoUtils$FileReader.<init>(IoUtils.java:207) 
                                                 at libcore.io.IoUtils.readFileAsString(IoUtils.java:114) 
                                                 at android.text.Hyphenator.loadHyphenator(Hyphenator.java:96) 
                                                 at android.text.Hyphenator.init(Hyphenator.java:154) 
                                                 at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:207) 
                                                 at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:186) 
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593) 
07-22 03:17:50.686 1202-1202/? E/Hyphenator: error loading hyphenation /system/usr/hyphen-data/hyph-hy.pat.txt
                                             java.io.FileNotFoundException: /system/usr/hyphen-data/hyph-hy.pat.txt: open failed: ENOENT (No such     file or directory)
                                                 at libcore.io.IoBridge.open(IoBridge.java:452)
                                                 at libcore.io.IoUtils$FileReader.<init>(IoUtils.java:207)
                                                 at libcore.io.IoUtils.readFileAsString(IoUtils.java:114)
                                                 at android.text.Hyphenator.loadHyphenator(Hyphenator.java:96)
                                                 at android.text.Hyphenator.init(Hyphenator.java:154)
                                                 at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:207)
                                                 at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:186)
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
                                              Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
                                                 at libcore.io.Posix.open(Native Method)
                                                 at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
                                                 at libcore.io.IoBridge.open(IoBridge.java:438)
                                                 at libcore.io.IoUtils$FileReader.<init>(IoUtils.java:207) 
                                                 at libcore.io.IoUtils.readFileAsString(IoUtils.java:114) 
                                                 at android.text.Hyphenator.loadHyphenator(Hyphenator.java:96) 
                                                 at android.text.Hyphenator.init(Hyphenator.java:154) 
                                                 at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:207) 
                                                 at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:186) 
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593) 
07-22 03:17:50.689 1202-1202/? E/Hyphenator: error loading hyphenation /system/usr/hyphen-data/hyph-nb.pat.txt
                                             java.io.FileNotFoundException: /system/usr/hyphen-data/hyph-nb.pat.txt: open failed: ENOENT (No such     file or directory)
                                                 at libcore.io.IoBridge.open(IoBridge.java:452)
                                                 at libcore.io.IoUtils$FileReader.<init>(IoUtils.java:207)
                                                 at libcore.io.IoUtils.readFileAsString(IoUtils.java:114)
                                                 at android.text.Hyphenator.loadHyphenator(Hyphenator.java:96)
                                                 at android.text.Hyphenator.init(Hyphenator.java:154)
                                                 at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:207)
                                                 at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:186)
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
                                              Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
                                                 at libcore.io.Posix.open(Native Method)
                                                 at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
                                                 at libcore.io.IoBridge.open(IoBridge.java:438)
                                                 at libcore.io.IoUtils$FileReader.<init>(IoUtils.java:207) 
                                                 at libcore.io.IoUtils.readFileAsString(IoUtils.java:114) 
                                                 at android.text.Hyphenator.loadHyphenator(Hyphenator.java:96) 
                                                 at android.text.Hyphenator.init(Hyphenator.java:154) 
                                                 at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:207) 
                                                 at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:186) 
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593) 
07-22 03:17:50.689 1202-1202/? E/Hyphenator: error loading hyphenation /system/usr/hyphen-data/hyph-nn.pat.txt
                                             java.io.FileNotFoundException: /system/usr/hyphen-data/hyph-nn.pat.txt: open failed: ENOENT (No such     file or directory)
                                                 at libcore.io.IoBridge.open(IoBridge.java:452)
                                                 at libcore.io.IoUtils$FileReader.<init>(IoUtils.java:207)
                                                 at libcore.io.IoUtils.readFileAsString(IoUtils.java:114)
                                                 at android.text.Hyphenator.loadHyphenator(Hyphenator.java:96)
                                                 at android.text.Hyphenator.init(Hyphenator.java:154)
                                                 at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:207)
                                                 at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:186)
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
                                              Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
                                                 at libcore.io.Posix.open(Native Method)
                                                 at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
                                                 at libcore.io.IoBridge.open(IoBridge.java:438)
                                                 at libcore.io.IoUtils$FileReader.<init>(IoUtils.java:207) 
                                                 at libcore.io.IoUtils.readFileAsString(IoUtils.java:114) 
                                                 at android.text.Hyphenator.loadHyphenator(Hyphenator.java:96) 
                                                 at android.text.Hyphenator.init(Hyphenator.java:154) 
                                                 at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:207) 
                                                 at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:186) 
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593) 
07-22 03:17:50.689 1202-1202/? E/Hyphenator: error loading hyphenation /system/usr/hyphen-data/hyph-sa.pat.txt
                                             java.io.FileNotFoundException: /system/usr/hyphen-data/hyph-sa.pat.txt: open failed: ENOENT (No such     file or directory)
                                                 at libcore.io.IoBridge.open(IoBridge.java:452)
                                                 at libcore.io.IoUtils$FileReader.<init>(IoUtils.java:207)
                                                 at libcore.io.IoUtils.readFileAsString(IoUtils.java:114)
                                                 at android.text.Hyphenator.loadHyphenator(Hyphenator.java:96)
                                                 at android.text.Hyphenator.init(Hyphenator.java:154)
                                                 at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:207)
                                                 at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:186)
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
                                              Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
                                                 at libcore.io.Posix.open(Native Method)
                                                 at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
                                                 at libcore.io.IoBridge.open(IoBridge.java:438)
                                                 at libcore.io.IoUtils$FileReader.<init>(IoUtils.java:207) 
                                                 at libcore.io.IoUtils.readFileAsString(IoUtils.java:114) 
                                                 at android.text.Hyphenator.loadHyphenator(Hyphenator.java:96) 
                                                 at android.text.Hyphenator.init(Hyphenator.java:154) 
                                                 at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:207) 
                                                 at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:186) 
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593) 
07-22 03:17:50.690 1202-1202/? E/Hyphenator: error loading hyphenation /system/usr/hyphen-data/hyph-und-ethi.pat.txt
                                             java.io.FileNotFoundException: /system/usr/hyphen-data/hyph-und-ethi.pat.txt: open failed: ENOENT (No     such file or directory)
                                                 at libcore.io.IoBridge.open(IoBridge.java:452)
                                                 at libcore.io.IoUtils$FileReader.<init>(IoUtils.java:207)
                                                 at libcore.io.IoUtils.readFileAsString(IoUtils.java:114)
                                                 at android.text.Hyphenator.loadHyphenator(Hyphenator.java:96)
                                                 at android.text.Hyphenator.init(Hyphenator.java:154)
                                                 at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:207)
                                                 at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:186)
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
                                              Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
                                                 at libcore.io.Posix.open(Native Method)
                                                 at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
                                                 at libcore.io.IoBridge.open(IoBridge.java:438)
                                                 at libcore.io.IoUtils$FileReader.<init>(IoUtils.java:207) 
                                                 at libcore.io.IoUtils.readFileAsString(IoUtils.java:114) 
                                                 at android.text.Hyphenator.loadHyphenator(Hyphenator.java:96) 
                                                 at android.text.Hyphenator.init(Hyphenator.java:154) 
                                                 at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:207) 
                                                 at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:186) 
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593) 
07-22 03:17:55.360 1200-1200/? E/installd: eof
07-22 03:17:55.360 1200-1200/? E/installd: failed to read size
07-22 03:18:04.400 1770-1770/system_process E/PowerManagerService-JNI: Couldn't load power module (No such file or directory)
07-22 03:18:05.226 1182-1291/? E/SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
07-22 03:18:09.550 1770-1770/system_process E/art: DexFile_getDexOptNeeded file '/system/framework/org.apache.http.legacy.jar' does not exist

I get a timeout error after 300 seconds.

I'll try to give you all the specs (let me know if i missed something):

My macbook:

  • Macbook Pro (15 inch, 2.53 GHz, Mid 2009)
  • OSX El Capitan (10.11.15)
  • Processor: 2.53GHz Intel Core 2 Duo
  • Memory: 8 GB 1333 MHz DDR3
  • Graphics: NVIDIA GeForce 9400M 256 MB

Android Studio:

  • Build #AI-143.2915827
  • JRE: 1.8.0_91-b14 x86_64
  • JVM: Java HotSpot(TM) 64-Bit Server VM by Oracle Corporation
  • SDK Platform: Android 6X (N)
  • SDK Tools installed: Android SDK Build Tools, Android SDK Platform-Tools 24.0.1 Android SDK Tools 25.1.7, Google Repository, Intel x86 Emulator Accelerator (HAXM Installer)

Emulator(ive tried different ones with different settings):

  • Nexus 5X
  • Marshmallow, API 23, ABI x86, Target Android 6.0 (with Google APIs)
  • Graphics: Auto
  • RAM: 1536mb, VM heap: 64mb, Internal Storage: 800mb
  • SD card: Studio Managed 100mb

I hope I was detailed enough, maybe even too detailed. I've just been google'ing solutions for hours on end and havent found anything.

Any and all help is appreciated

回答1:

I have same configuration with same jre but all running fine.

As I see your error log there are some .so files are missing.

.so files are packaged during distribution of Unix/linux bundles, so the android studio which you download have corrupted.

It also be happen due to bad driver config.

I recommend to get or download new android studio then install.

If you have issue with only emulator then just attach any android device with system and watch your build on it.



回答2:

I think some of your needed .so files is missing.. and also seeing some permission problems.. Check the library path in the log whether the .so file is there or not.?

You are working in sudo mode right..? Delete the existing one download a new one Android Studio-2.0+ also delete the existing sdk and download a new. give the files read/write permission. Also increase the VM heap to 200MB minimum.



回答3:

One solution to the error error loading hyphenation /system/usr/hyphen-data/hyph-nn.pat.txt is for when your main Activity extends AppCompatActivity to ensure that your theme set in AndroidManifest.xml is set to an AppCompat theme. E.g. look for android:theme= it should be set to something with "AppCompat" in it like @style/Theme.AppCompat.Light.NoActionBar.