我是Android开发人员的新手。我关注http://developer.android.com/training/basics/firstapp/building-ui.html。当我做简单的hello world应用程序时,第一次应用程序在模拟器上运行。现在我试图运行下一个application.application没有安装在模拟器上,即模拟器没有显示应用程序名称和应用程序图标。然后我从包浏览器中删除了两个应用程序并重新启动了laptop.then我再次进行第二次应用程序并尝试安装在emulator.Emulator上再次没有显示应用程序。然后我尝试在模拟器上安装hello world应用程序,这也不起作用。我检查了min。 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后,控制台无法显示 无法加载libGL.so [2012-12-28 21:23:45 - 仿真器]错误libGL.so:无法打开共享对象文件:没有这样的文件或目录 [2012-12-28 21:23:45 - 仿真器]无法加载libGL.so [2012-12-28 21:23:45 - 仿真器]错误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>
关于
的Ajay
答案 0 :(得分:1)
看起来你喜欢在Linux上开发。您需要将一个有效的libGL.so符号链接到您的32位lib目录中。这可以像“sudo ln -s /usr/lib/libGL.so.1 /usr/lib/libGL.so”一样简单。
答案 1 :(得分:0)
libGL.so属于Mesa libGL运行时库。模拟器抱怨因为它找不到32位Mesa库。安装适用于i386 / i686架构的Mesa: