我是android開發人員的新手。我正在關注http://developer.android.com/training/basics/firstapp/building-ui.html。當我讓簡單的Hello World應用程序第一次在模擬器上運行應用程序。現在我試圖運行未安裝在仿真器上的下一個application.application,即Emulator未顯示應用程序名稱和應用程序圖標。然後,我從包資源管理器中刪除了這兩個應用程序,然後重新啓動laptop.then,然後再次提交第二個應用程序並嘗試安裝在emulator.Emulator上再次沒有顯示應用程序。然後我嘗試在模擬器上安裝hello world應用程序,這也不行。我檢查了最小。 sdk版本和android manifest.xml中的目標sdk版本,它們都是正確的。你好是第二個應用程序的項目名稱。模擬器未安裝應用程序
控制檯表示activity_mail.xml的
[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'!
代碼是string.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>
代碼是
<?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控制檯donesn't節目 無法加載libGL.so [2012-12-28 21:23:4 5 - Emulator]錯誤libGL.so:無法打開共享目標文件:沒有這樣的文件或目錄 [2012-12-28 21:23:45 - Emulator]加載失敗libGL.so [2012-12-28 21: 23:45 - 仿真器]錯誤libGL.so:無法打開共享目標文件:沒有這樣的文件或目錄 但仍然應用程序勝利,安裝在仿真器上。
這是Hello應用程序
<?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>
與問候
阿賈伊
你可以發佈你的家庭活動,並作爲清單? – Sobo
不明白你問什麼? – user1931418
你有activity_mail.xml(這是屏幕布局文件)和Strings.xml(這是它從中獲取字符串變量的地方)。但是你沒有主要活動文件(它主要位於「src」文件夾下)。看看你的錯誤,我相信它被稱爲「MainActivity」和AndroidManifest文件(通常位於項目的根目錄)如果你可以發佈這兩個文件以及可能有助於找出你的問題。 – Sobo