【问题标题】:emulator is not installing app模拟器没有安装应用程序
【发布时间】:2012-12-27 16:11:53
【问题描述】:

我是安卓开发者的新手。我关注http://developer.android.com/training/basics/firstapp/building-ui.html。当我第一次制作简单的 hello world 应用程序时,应用程序在模拟器上运行。现在我正在尝试运行下一个应用程序。应用程序未安装在模拟器上,即模拟器没有显示应用程序名称和应用程序图标。然后我从包资源管理器中删除了这两个应用程序并重新启动笔记本电脑。然后我再次制作第二个应用程序并尝试安装在 emulator.Emulator 上再次没有显示应用程序。然后我尝试在模拟器上安装 hello world 应用程序,这也不起作用。我检查了最小值。 android manifest.xml 中的sdk 版本和目标sdk 版本都是正确的。Hello 是第二个应用程序的项目名称。

控制台正在显示

[2012-12-28 21:23:21 - Hello] ------------------------------
[2012-12-28 21:23:21 - Hello] Android Launch!
[2012-12-28 21:23:21 - Hello] adb is running normally.
[2012-12-28 21:23:21 - Hello] Performing com.example.hello.MainActivity activity launch
[2012-12-28 21:23:21 - Hello] Automatic Target Mode: launching new emulator with compatible AVD 'Froyo'
[2012-12-28 21:23:21 - Hello] Launching a new emulator with Virtual Device 'Froyo'
[2012-12-28 21:23:21 - Emulator] Failed to load libGL.so
[2012-12-28 21:23:21 - Emulator] error libGL.so: cannot open shared object file: No such file or directory
[2012-12-28 21:23:21 - Emulator] Failed to load libGL.so
[2012-12-28 21:23:21 - Emulator] error libGL.so: cannot open shared object file: No such file or directory
[2012-12-28 21:23:21 - Emulator] emulator: emulator window was out of view and was recentered
[2012-12-28 21:23:21 - Emulator] 
[2012-12-28 21:23:21 - Hello] New emulator found: emulator-5554
[2012-12-28 21:23:21 - Hello] Waiting for HOME ('android.process.acore') to be launched...
[2012-12-28 21:23:28 - Hello] emulator-5554 disconnected! Cancelling 'com.example.hello.MainActivity activity launch'!
[2012-12-28 21:23:43 - Hello] ------------------------------
[2012-12-28 21:23:43 - Hello] Android Launch!
[2012-12-28 21:23:43 - Hello] adb is running normally.
[2012-12-28 21:23:43 - Hello] Performing com.example.hello.MainActivity activity launch
[2012-12-28 21:23:44 - Hello] Automatic Target Mode: launching new emulator with compatible AVD 'Froyo'
[2012-12-28 21:23:44 - Hello] Launching a new emulator with Virtual Device 'Froyo'
[2012-12-28 21:23:45 - Emulator] Failed to load libGL.so
[2012-12-28 21:23:45 - Emulator] error libGL.so: cannot open shared object file: No such file or directory
[2012-12-28 21:23:45 - Emulator] Failed to load libGL.so
[2012-12-28 21:23:45 - Emulator] error libGL.so: cannot open shared object file: No such file or directory
[2012-12-28 21:23:45 - Emulator] emulator: emulator window was out of view and was recentered
[2012-12-28 21:23:45 - Emulator] 
[2012-12-28 21:23:45 - Hello] New emulator found: emulator-5554
[2012-12-28 21:23:45 - Hello] Waiting for HOME ('android.process.acore') to be launched...
[2012-12-28 21:23:59 - Hello] emulator-5554 disconnected! Cancelling 'com.example.hello.MainActivity activity launch'!

activity_mail.xml 的代码是

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">

<EditText android:id="@+id/edit_message"
    android:layout_weight="1"
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:hint="@string/edit_message"
    />

<Button android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/button_send"/>

 </LinearLayout>

string.xml 的代码是

<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">My First App</string>
<string name="edit_message">Enter a message</string>
<string name="button_send">Send</string>
<string name="menu_settings">Settings</string>
<string name="title_activity_main">MainActivity</string>
</resources>

安装 libGL.so 后控制台不显示 无法加载 libGL.so [2012-12-28 21:23:45 - Emulator] 错误 libGL.so:无法打开共享对象文件:没有这样的文件或目录 [2012-12-28 21:23:45 - 模拟器] 无法加载 libGL.so [2012-12-28 21:23:45 - Emulator] 错误 libGL.so:无法打开共享对象文件:没有这样的文件或目录 但应用程序仍然无法安装在模拟器上。

这是hello应用程序的androidmanifest.xml文件

 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.example.second"
  android:versionCode="1"
   android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.example.second.Second"
        android:label="@string/app_name" android:icon="@drawable/ic_launcher"                android:theme="@style/AppBaseTheme" android:showOnLockScreen="true">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

</manifest>

关于

【问题讨论】:

  • 你能发布你的家庭活动吗?
  • 不明白你在问什么?
  • 你有activity_mail.xml(这是屏幕布局文件)和Strings.xml(这是它获取字符串变量的地方)。但是您没有主活动文件(它通常位于“src”文件夹下)。查看您的错误,我相信它称为“MainActivity”和 AndroidManifest 文件(通常位于项目的根目录中)如果您也可以发布这两个文件,这可能有助于找出您的问题。
  • 源代码与网页 developer.android.com/training/basics/firstapp/building-ui.html 上给出的相同,我在该目标 sdk =17 和 min 中看到了 android manifest.xml。 sdk =8 都是正确的。不知道怎么办?我应该通过删除 eclipse 和 android sdk 文件夹来重新安装 eclipse 的 adt 插件吗?对于安装 eclipse 和 android sdk,我可以使用它们各自的 zip。文件夹。
  • 尝试在 Manifest 中设置以下内容... android:minSdkVersion="4" android:targetSdkVersion="8" />

标签: android emulation


【解决方案1】:

看起来您正在 Linux 上进行开发。您需要将一个工作 libGL.so 符号链接到您的 32 位 lib 目录中。这可以像“sudo ln -s /usr/lib/libGL.so.1 /usr/lib/libGL.so”一样简单。

【讨论】:

  • 我在终端上尝试了该行,然后我重新启动笔记本电脑并尝试再次运行应用程序,但它仍然无法正常工作。在控制台中它不显示加载 libGL.so 失败
【解决方案2】:

libGL.so 属于 Mesa libGL 运行时库。模拟器抱怨,因为它找不到 32 位 Mesa 库。为 i386 / i686 架构安装 Mesa:

【讨论】:

  • 我使用了这个命令 sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so.after使用它我重新安装 eclipse 并再次运行第二个应用程序控制台没有显示 Failed to load libGL.so 并且模拟器没有安装应用程序
  • 你也可以关注这个链接redips.net/android/emulator-fedora-linux
  • 你能提供另一个链接或任何其他帮助吗?
猜你喜欢
  • 1970-01-01
  • 2020-12-05
  • 2015-02-12
  • 1970-01-01
  • 2020-07-01
  • 1970-01-01
  • 2012-02-12
  • 2013-10-06
  • 1970-01-01
相关资源
最近更新 更多