无法获得应用程序'在AVD中展示

时间:2012-04-18 09:04:48

标签: android cordova avd

编辑: 似乎我一直在正确的轨道上,10 +(左右)重新启动和瞧。它有效。

首先,我试图让AVD启动并运行,然后用真正简单的“helloWorld”进行测试。

我使用Android 4.0.3,如果这可能很重要。

在内存分配和运行时遇到麻烦之后,你将它命名为.. AVD现已启动并运行,没有任何警告或错误。

我可以在上面安装我的项目..

[2012-04-17 23:28:04 - AndroidProj] Android Launch!
[2012-04-17 23:28:04 - AndroidProj] adb is running normally.
[2012-04-17 23:28:04 - AndroidProj] Performing com.phonegap.helloworld.AndroidProjActivity activity launch
[2012-04-17 23:28:09 - AndroidProj] Uploading AndroidProj.apk onto device 'emulator-5554'
[2012-04-17 23:28:12 - AndroidProj] Installing AndroidProj.apk...
[2012-04-17 23:28:54 - AndroidProj] Success!
[2012-04-17 23:28:54 - AndroidProj] Starting activity com.phonegap.helloworld.AndroidProjActivity on device emulator-5554

我使用的所有代码几乎只是教程中的复制+粘贴:

'主要' Java的文件。 (@AndroidProj / src / com.phonegap.helloworld)

package com.phonegap.helloworld;

import org.apache.cordova.*;
/*import com.phonegap.DroidGap;*/
import android.os.Bundle;

public class AndroidProjActivity extends DroidGap {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        super.loadUrl("file:///android_asset/www/index.html");
    }
}

和html(@AndroidProj / assets / www)

<!DOCTYPE HTML>
<html>
<head>
<title>PhoneGap</title>
<script type="text/javascript" charset="utf-8" src="cordova-1.6.0.js"></script>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>

的AndroidManifest.xml:

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

    <supports-screens
        android:largeScreens="true"
        android:normalScreens="true"
        android:smallScreens="true"
        android:resizeable="true"
        android:anyDensity="true"
    />

    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.RECEIVE_SMS" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.WRITE_CONTACTS" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.BROADCAST_STICKY" />

    <uses-sdk android:minSdkVersion="15" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:name=".AndroidProjActivity"
            android:label="@string/app_name" 
            android:configChanges="orientation|keyboardHidden">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

        <activity android:name="org.apache.cordova.DroidGap" android:label="@string/app_name" android:configChanges="orientation|keyboardHidden"> 
        <intent-filter> </intent-filter> 
        </activity> 
    </application>

</manifest>

除了我永远需要安装我的项目,它似乎正确执行。 但是,我得到的只是模拟器,我的项目/文件无处可寻。 问题所在的任何线索?

enter image description here

4 个答案:

答案 0 :(得分:0)

您是否尝试直接从已安装的应用程序运行它? 因为安装成功,你应该是

答案 1 :(得分:0)

根据建议,我会自己“回答”。

原来没有问题,至少在代码方面没有问题,以后会有一堆重启,而且一切都顺利进行。

感谢您的努力。

答案 2 :(得分:0)

我遇到了同样的问题。我重新开始黯然失色,一切都很顺利。

答案 3 :(得分:-1)

使用鼠标Luke - 点击带有矩形的圆圈底部的第3个图标 这将显示小绿人将使用helloworld显示的所有应用程序