Android Studio模拟器不会运行简单的Hello World应用程序

时间:2016-07-22 04:24:56

标签: java android macos android-studio android-emulator

我无法在Android Studio(2.1.2)中运行简单的hello world应用程序。它将加载模拟器,我将获得一个带有Android图形的黑屏,就像手机正在打开一样。

我一直处理这些问题,google&#da; da ton,搞砸了一堆设置,然后决定我应该使用以下步骤完全卸载Android Studio:{{3}并从头开始重新安装。

所以我卸载了,然后重新安装了Android Studio,启动了应用程序,下载了推荐的SDK以及所有这些,并创建了一个空活动的新Android Studio项目。在那之后,我没有添加或删除任何代码,我只是创建了一个新的模拟器并在其上运行应用程序。当然,这并没有解决我的问题

我在logcat中收到以下错误,而#34;等待目标设备上线..." :

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

300秒后我收到超时错误。

我会尝试给你所有的规格(让我知道,如果我错过了一些东西):

我的macbook:

  • Macbook Pro(15英寸,2.53 GHz,2009年中)
  • OSX El Capitan(10.11.15)
  • 处理器:2.53GHz Intel Core 2 Duo
  • 内存:8 GB 1333 MHz DDR3
  • 图形:NVIDIA GeForce 9400M 256 MB

Android Studio:

  • 构建#AI-143.2915827
  • JRE:1.8.0_91-b14 x86_64
  • JVM:Oracle Corporation的Java HotSpot(TM)64位服务器VM
  • SDK平台:Android 6X(N)
  • 安装了SDK工具:Android SDK Build Tools,Android SDK Platform-Tools 24.0.1 Android SDK工具25.1.7,Google Repository, 英特尔x86仿真器加速器(HAXM安装程序)

模拟器(香港专业教育学院尝试过不同的设置):

  • Nexus 5X
  • Marshmallow,API 23,ABI x86,Target Android 6.0(使用Google API)
  • 图形:自动
  • RAM:1536mb,VM堆:64mb,内部存储:800mb
  • SD卡:工作室管理100mb

我希望我足够详细,甚至可能过于详细。我只是谷歌解决了几个小时的解决方案,并没有找到任何东西。

感谢任何和所有帮助

3 个答案:

答案 0 :(得分:3)

我有相同的配置和相同的jre,但都运行良好。

当我看到你的错误日志时,有一些.so文件丢失了。

.so文件在Unix / linux捆绑包的分发过程中打包,因此你下载的android studio已经损坏。

由于驱动程序配置错误也会发生这种情况。

我建议获取或下载新的android studio然后安装。

如果您只遇到模拟器问题,那么只需将任何Android设备与系统相关联,然后在其上观看构建。

答案 1 :(得分:1)

我认为你需要的一些.so文件丢失..并且还看到一些权限问题。检查日志中的库路径是否存在.so文件。?

你正在以sudo模式工作..? 删除现有的一个下载一个新的Android Studio-2.0 +也删除现有的sdk并下载一个新的。给予文件读/写权限。 同时将VM堆增加到最小200MB。

答案 2 :(得分:1)

错误error loading hyphenation /system/usr/hyphen-data/hyph-nn.pat.txt的一个解决方案是当您的主要活动扩展AppCompatActivity以确保您在AndroidManifest.xml中设置的主题设置为AppCompat主题时。例如。寻找android:theme=它应该被设置为&#34; AppCompat&#34;就像@style/Theme.AppCompat.Light.NoActionBar一样。