【发布时间】:2014-07-29 16:00:08
【问题描述】:
我正在尝试使用 Phonegap 创建一个 Hello World 应用程序,但是当我调用在模拟器上运行应用程序时它会崩溃。我遵循了here 的指导方针。这是我在 MainActivity.java 上的内容:
package com.example.hello;
import android.os.Bundle;
import org.apache.cordova.*;
public class HelloWorld extends CordovaActivity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
super.init();
// Set by <content src="index.html" /> in config.xml
super.loadUrl(Config.getStartUrl());
//super.loadUrl("file:///android_asset/www/index.html");
}
}
这是我的 AndroidManifest.xml:
<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="0.0.1" android:windowSoftInputMode="adjustPan" package="com.example.hello" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/app_name" android:launchMode="singleTop" android:name="HelloWorld" android:theme="@android:style/Theme.Black.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="20" />
</manifest>
这是我得到的第一个错误:
- Chromium WebView 不存在
- 致命异常:主要
- java.lang.RuntimeException:无法启动活动 组件信息{com.example.deneme/com.example.deneme.MainActivity}: java.lang.UnsupportedOperationException
你能告诉我申请有什么问题吗?谢谢。
【问题讨论】:
-
DroidGap不是已弃用吗?另外,您是否正确创建了 phonegap 项目?当我说得正确时,我的意思是像here所描述的那样。 -
@XaverKapeller 我遵循了一个过时的指南,谢谢你的链接..
-
@XaverKapeller 我已经创建了链接中准确描述的phonegap。我仍然遇到同样的错误..
-
您是否尝试在读取设备上启动应用程序?