Java ChromiumWebView不存在

Java ChromiumWebView不存在,java,android,cordova,Java,Android,Cordova,我正在尝试使用Phonegap创建Hello World应用程序,但当我调用run the application on emulator时,它崩溃了。我遵循了指导方针。以下是我对MainActivity.java的了解: package com.example.hello; import android.os.Bundle; import org.apache.cordova.*; public class HelloWorld extends CordovaActivity {

我正在尝试使用Phonegap创建Hello World应用程序,但当我调用run the application on emulator时,它崩溃了。我遵循了指导方针。以下是我对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");
    }
}
package com.example.hello;
导入android.os.Bundle;
导入org.apache.cordova.*;
公共类HelloWorld扩展了CordovaActivity
{
@凌驾
创建时的公共void(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
super.init();
//在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>

以下是我得到的第一个错误:

  • ChromiumWebView不存在
  • 致命异常:主
  • java.lang.RuntimeException:无法启动活动 ComponentInfo{com.example.deneme/com.example.deneme.MainActivity}: java.lang.UnsupportedOperationException

  • 你能告诉我这个申请有什么问题吗?谢谢。

    事实上,并非所有Android手机都附带Chromium作为WebView引擎()。例如,我的三星Galaxy Ace2和安卓4.1.2都有旧的WebView引擎。用户代理字符串表示一些未知的Mozilla版本,HTML5应用程序的外观和行为与Chrome不同。但是,PhoneGap应用不会在我的手机上引发错误

    我不知道为什么会出现“Chromium WebView不存在”错误,但由于您正处于起步阶段(因为您试图使用Phonegap构建Hello World应用程序),我想指出另一个选项。通过使用project,您不必在每个android设备上处理各种WebView引擎,而是可以在应用程序中使用嵌入的chromium引擎——在每个android设备上都是一样的。人行横道项目适用于android和tizen平台。因此,要构建跨平台应用程序(android和iOS),我建议使用以下两种方法之一

    • ,它可以使用单个html5源代码和XDK api和Cordova api,可以使用crosswalk编译到android应用程序,也可以使用本机WebView编译到iOS
    • 构建android应用程序和PhoneGap从相同来源构建iOS应用程序
    这种方法可以消除支持各种android设备的痛苦

    另见:


    DroidGap是否已弃用?您是否正确创建了phonegap项目?当我说的正确时,我的意思是“如所述”。@XaverKapeller我遵循的是一条过时的指导原则,感谢链接。@XaverKapeller我创建了链接中所述的phonegap。我仍然会遇到同样的错误..类似的问题-您是否尝试在读取设备上启动应用程序?