铬web视图不存在 [英] Chromium WebView does not exist

查看:146
本文介绍了铬web视图不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个使用PhoneGap的一个Hello World应用程序,但它崩溃,当我打电话运行模拟器上的应用程序。我跟着指引<一href="http://docs.phonegap.com/en/edge/guide_platforms_android_index.md.html#Android%20Platform%20Guide"相对=nofollow>此处。以下是我对MainActivity.java:

I am trying to create a Hello World app using Phonegap but it crashes when I call run the application on emulator. I followed the guideline here. Here is what I have on 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");
    }
}

下面是我的Andr​​oidManifest.xml:

Here is my 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>

这是第一个错误,我得到:

Here is the first errors I get :

  1. 在铬的WebView不存在
  2. 致命异常:主要
  3. 在了java.lang.RuntimeException:无法启动活动 ComponentInfo {com.example.deneme / com.example.deneme.MainActivity}: java.lang.UnsupportedOperationException
  1. Chromium WebView does not exist
  2. FATAL EXCEPTION: main
  3. java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.deneme/com.example.deneme.MainActivity}: java.lang.UnsupportedOperationException

你能告诉我什么是错误的应用程序?谢谢你。

Can you tell me what is wrong with the application? Thanks.

推荐答案

其实,每一个Android手机附带铬并不像web视图引擎(的 https://developer.chrome.com/multidevice/webview/overview )。例如,我的三星Galaxy的Ace2了Android 4.1.2已经老了的WebView引擎。用户代理字符串表示一些未知的Mozilla的版本,HTML5应用程序的外观和放大器;感觉和行为不同于浏览器。然而,PhoneGap的应用程序不会在我的手机引发错误。

Actually, not every Android phone ships with Chromium as WebView engine (https://developer.chrome.com/multidevice/webview/overview). For instance, my Samsung Galaxy Ace2 with Android 4.1.2 has old WebView engine. User agent string denotes some unknown Mozilla version, HTML5 apps look&feel and behavior differs from Chrome. However, PhoneGap apps do not raise errors on my phone.

我不知道为什么你要铬的WebView不存在的错误,但因为你在很beginnig对你的方式(因为你正在试图建立使用PhoneGap的的Hello World应用程序)我想以指向另一种选择。使用人行横道项目可以让你不应对各种web视图引擎的每一个Android设备上,但使用嵌入在应用程序中铬的发动机 - 总是每一个Android设备上的相同。人行横道项目是可用于Android和tizen平台。因此,要构建跨平台的应用(Android版的iOS),我会建议以使用

I don't know why you're getting "Chromium WebView does not exist" error, but since you're on the very beginnig on your way (cause you're trying to build Hello World app using Phonegap) I want to point to another option. Using Crosswalk project allows you not to deal with various WebView engines on every android device but use embedded in your app chromium engine - always the same on every android device. The crosswalk project is available for android and tizen platforms. So to build crossplatform app (android an iOS) I would suggest to use either

  • 英特尔XDK ,它可以使用单一的HTML5源$ C ​​$ C与XDK API和科尔多瓦的API,可以被编译到Android使用人行横道的应用程序或编译使用原生的WebView的iOS。
  • 人行横道+科尔多瓦构建Android应用程序,PhoneGap的建设从同一来源的iOS应用
  • Intel XDK, which can use single html5 source code with XDK api and Cordova api, that can be compiled to android app using crosswalk or compiled to iOS using native WebView.
  • Crosswalk+Cordova to build android app and PhoneGap to build iOS app from the same sources

此方法可以在支持各种Android设备消除疼痛。

This approach can eliminate pain on supporting various android devices.

另请参阅:

http://html5hub.com/building-cordova-applications-with-crosswalk /

https://groups.google.com/forum/#​​!topic/ PhoneGap的/ IxSuRUScbMs

这篇关于铬web视图不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆