Android应用程序无法启动失踪铬的WebView [英] Android app failing to start missing Chromium WebView

查看:210
本文介绍了Android应用程序无法启动失踪铬的WebView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用煎茶触摸与PhoneGap的/科尔多瓦打造的Andr​​oid应用程序。当我的应用程序启动时,我得到一个白色的屏幕,沿东西线MyApp的,不幸的是,已经停止。如何以及在哪里我添加了铬的WebView?

下面的日志说,它缺少铬的WebView,但我似乎无法找出其中是或什么补充。

我发现 http://docs.phonegap.com/en /3.0.0/guide_platforms_android_webview.md.html 但cordovaWebView一样铬?另外,商务部似乎是过时了。

LogCat中

  16 07-28:45:21.433:I / ActivityManager(1234):开始PROC org.MyApp.mMyApp的活动org.MyApp.mMyApp / .mMyApp:PID = 1672 UID = 10019导报= {50019,3003,1028,1015}
07-28 16:45:21.453:I / CordovaLog(1672):改变日志级别为DEBUG(3)
07-28 16:45:21.453:D / CordovaActivity(1672):CordovaActivity.onCreate()
07-28 16:45:21.453:E / WebViewFactory(1672):铬的WebView不存在
07-28 16:45:21.453:E / WebViewFactory(1672):铬的WebView不存在
07-28 16:45:21.453:D / AndroidRuntime(1672):关闭VM
07-28 16:45:21.453:W / dalvikvm(1672):主题ID = 1:螺纹未捕获的异常(组= 0xb0e0cce8)退出
07-28 16:45:21.463:E / AndroidRuntime(1672):致命异常:主要
07-28 16:45:21.463:E / AndroidRuntime(1672):工艺:org.MyApp.mMyApp,PID:1672
07-28 16:45:21.463:E / AndroidRuntime(1672):了java.lang.RuntimeException:无法启动活动ComponentInfo {org.MyApp.mMyApp / org.MyApp.mMyApp.mMyApp}:java.lang.UnsupportedOperationException
07-28 16:45:21.463:E / AndroidRuntime(1672):在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2197)
07-28 16:45:21.463:E / AndroidRuntime(1672):在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2258)
07-28 16:45:21.463:E / AndroidRuntime(1672):在android.app.ActivityThread.access $ 800(ActivityThread.java:138)
07-28 16:45:21.463:E / AndroidRuntime(1672):在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1209)
07-28 16:45:21.463:E / AndroidRuntime(1672):在android.os.Handler.dispatchMessage(Handler.java:102)
07-28 16:45:21.463:E / AndroidRuntime(1672):在android.os.Looper.loop(Looper.java:136)
07-28 16:45:21.463:E / AndroidRuntime(1672):在android.app.ActivityThread.main(ActivityThread.java:5026)
07-28 16:45:21.463:E / AndroidRuntime(1672):在java.lang.reflect.Method.invokeNative(本机方法)
07-28 16:45:21.463:E / AndroidRuntime(1672):在java.lang.reflect.Method.invoke(Method.java:515)
07-28 16:45:21.463:E / AndroidRuntime(1672):在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:777)
07-28 16:45:21.463:E / AndroidRuntime(1672):在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
07-28 16:45:21.463:E / AndroidRuntime(1672):在dalvik.system.NativeStart.main(本机方法)
07-28 16:45:21.463:E / AndroidRuntime(1672):因:java.lang.UnsupportedOperationException
07-28 16:45:21.463:E / AndroidRuntime(1672):在com.android.webview.nullwebview.NullWebViewFactoryProvider.createWebView(NullWebViewFactoryProvider.java:41)
07-28 16:45:21.463:E / AndroidRuntime(1672):在android.webkit.WebView.ensureProviderCreated(WebView.java:2058)
07-28 16:45:21.463:E / AndroidRuntime(1672):在android.webkit.WebView.setOverScrollMode(WebView.java:2116)
07-28 16:45:21.463:E / AndroidRuntime(1672):在android.view.View<&初始化GT;(View.java:3461)
07-28 16:45:21.463:E / AndroidRuntime(1672):在android.view.View<&初始化GT;(View.java:3517)
07-28 16:45:21.463:E / AndroidRuntime(1672):在android.view.ViewGroup<&初始化GT;(ViewGroup.java:470)
07-28 16:45:21.463:E / AndroidRuntime(1672):在android.widget.AbsoluteLayout<&初始化GT;(AbsoluteLayout.java:52)
07-28 16:45:21.463:E / AndroidRuntime(1672):在android.webkit.WebView<&初始化GT;(WebView.java:498)
07-28 16:45:21.463:E / AndroidRuntime(1672):在android.webkit.WebView<&初始化GT;(WebView.java:475)
07-28 16:45:21.463:E / AndroidRuntime(1672):在android.webkit.WebView<&初始化GT;(WebView.java:455)
07-28 16:45:21.463:E / AndroidRuntime(1672):在android.webkit.WebView<&初始化GT;(WebView.java:444)
07-28 16:45:21.463:E / AndroidRuntime(1672):在android.webkit.WebView<&初始化GT;(WebView.java:434)
07-28 16:45:21.463:E / AndroidRuntime(1672):在org.apache.cordova.CordovaWebView<&初始化GT;(CordovaWebView.java:137)
07-28 16:45:21.463:E / AndroidRuntime(1672):在org.apache.cordova.CordovaActivity.makeWebView(CordovaActivity.java:314)
07-28 16:45:21.463:E / AndroidRuntime(1672):在org.apache.cordova.CordovaActivity.init(CordovaActivity.java:349)
07-28 16:45:21.463:E / AndroidRuntime(1672):在org.MyApp.mMyApp.mMyApp.onCreate(mMyApp.java:31)
07-28 16:45:21.463:E / AndroidRuntime(1672):在android.app.Activity.performCreate(Activity.java:5242)
07-28 16:45:21.463:E / AndroidRuntime(1672):在android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
07-28 16:45:21.463:E / AndroidRuntime(1672):在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2161)
07-28 16:45:21.463:E / AndroidRuntime(1672):11 ...更多

的Andr​​oid的manifest.xml

 < XML版本='1.0'编码='UTF-8'&GT?;
<表明机器人:hardwareAccelerated =真正的安卓版code =1机器人:=的versionName1.0.0机器人:windowSoftInputMode =adjustPan包=org.MyApplication.mMyApplication的xmlns:机器人= http://schemas.android.com/apk/res/android\">
    <支持屏安卓anyDensity =真正的机器人:largeScreens =真正的机器人:normalScreens =真正的机器人:调整大小=真正的机器人:smallScreens =真正的机器人:xlargeScreens =真/>
    <使用许可权的android:NAME =android.permission.INTERNET对/>
    <使用许可权的android:NAME =android.permission.WRITE_EXTERNAL_STORAG​​E/>
    <使用许可权的android:NAME =android.permission.READ_PHONE_STATE/>
    <应用机器人:可调试=真正的机器人:hardwareAccelerated =真正的机器人:图标=@绘制/图标机器人:标签=@字符串/ APP_NAME>
        <活动机器人:configChanges =方向| keyboardHidden |键盘|屏幕尺寸|区域机器人:标签=@字符串/ APP_NAME机器人:名字=mMyApplication安卓主题=@安卓风格/ Theme.Black.NoTitleBar >
            &所述;意图滤光器>
                <作用机器人:名字=android.intent.action.MAIN/>
                <类机器人:名字=android.intent.category.LAUNCHER/>
            &所述; /意图滤光器>
        < /活性GT;
    < /用途>
    <采用-SDK安卓的minSdkVersion =19机器人:targetSdkVersion =20/>
< /清单>

小脚本我为构建运行

 导入OS
#运行构建为这个应用程序
使用os.system(煎茶-d应用打造本土-run);
#目录更改成目录的PhoneGap
os.chdir(os.getcwd()+\\ PhoneGap的);
#推应用设备
使用os.system(PhoneGap的运行Android);
打印脚本完成


解决方案

是cordovaWebView一样铬 - 是的,它应该是。和最近的文档版本是这里

您最好的选择是使用的科尔多瓦CLI 煎茶Cmd的因为所有的WebView设置为你是自动完成的。

我不完全知道如何解决现有的设置,但我肯定会鼓励你使用上面提到的两个CLI工具之一......它减少了出错的可能性是这样的。

I am using sencha touch with phonegap/cordova to build the android app. When my app starts up i get a white screen with something along the lines of 'MyApp, unfortunatly, has stopped.' How and where do i add the Chromium WebView?

The logs below says it missing Chromium WebView but i can't seem to figure out where that is or what to add to that.

I have found http://docs.phonegap.com/en/3.0.0/guide_platforms_android_webview.md.html but is cordovaWebView the same as Chromium? Also the doc seems to be out of date.

LogCat

07-28 16:45:21.433: I/ActivityManager(1234): Start proc org.MyApp.mMyApp for activity org.MyApp.mMyApp/.mMyApp: pid=1672 uid=10019 gids={50019, 3003, 1028, 1015}
07-28 16:45:21.453: I/CordovaLog(1672): Changing log level to DEBUG(3)
07-28 16:45:21.453: D/CordovaActivity(1672): CordovaActivity.onCreate()
07-28 16:45:21.453: E/WebViewFactory(1672): Chromium WebView does not exist
07-28 16:45:21.453: E/WebViewFactory(1672): Chromium WebView does not exist
07-28 16:45:21.453: D/AndroidRuntime(1672): Shutting down VM
07-28 16:45:21.453: W/dalvikvm(1672): threadid=1: thread exiting with uncaught exception (group=0xb0e0cce8)
07-28 16:45:21.463: E/AndroidRuntime(1672): FATAL EXCEPTION: main
07-28 16:45:21.463: E/AndroidRuntime(1672): Process: org.MyApp.mMyApp, PID: 1672
07-28 16:45:21.463: E/AndroidRuntime(1672): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.MyApp.mMyApp/org.MyApp.mMyApp.mMyApp}: java.lang.UnsupportedOperationException
07-28 16:45:21.463: E/AndroidRuntime(1672):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2197)
07-28 16:45:21.463: E/AndroidRuntime(1672):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2258)
07-28 16:45:21.463: E/AndroidRuntime(1672):     at android.app.ActivityThread.access$800(ActivityThread.java:138)
07-28 16:45:21.463: E/AndroidRuntime(1672):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1209)
07-28 16:45:21.463: E/AndroidRuntime(1672):     at android.os.Handler.dispatchMessage(Handler.java:102)
07-28 16:45:21.463: E/AndroidRuntime(1672):     at android.os.Looper.loop(Looper.java:136)
07-28 16:45:21.463: E/AndroidRuntime(1672):     at android.app.ActivityThread.main(ActivityThread.java:5026)
07-28 16:45:21.463: E/AndroidRuntime(1672):     at java.lang.reflect.Method.invokeNative(Native Method)
07-28 16:45:21.463: E/AndroidRuntime(1672):     at java.lang.reflect.Method.invoke(Method.java:515)
07-28 16:45:21.463: E/AndroidRuntime(1672):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
07-28 16:45:21.463: E/AndroidRuntime(1672):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
07-28 16:45:21.463: E/AndroidRuntime(1672):     at dalvik.system.NativeStart.main(Native Method)
07-28 16:45:21.463: E/AndroidRuntime(1672): Caused by: java.lang.UnsupportedOperationException
07-28 16:45:21.463: E/AndroidRuntime(1672):     at com.android.webview.nullwebview.NullWebViewFactoryProvider.createWebView(NullWebViewFactoryProvider.java:41)
07-28 16:45:21.463: E/AndroidRuntime(1672):     at android.webkit.WebView.ensureProviderCreated(WebView.java:2058)
07-28 16:45:21.463: E/AndroidRuntime(1672):     at android.webkit.WebView.setOverScrollMode(WebView.java:2116)
07-28 16:45:21.463: E/AndroidRuntime(1672):     at android.view.View.<init>(View.java:3461)
07-28 16:45:21.463: E/AndroidRuntime(1672):     at android.view.View.<init>(View.java:3517)
07-28 16:45:21.463: E/AndroidRuntime(1672):     at android.view.ViewGroup.<init>(ViewGroup.java:470)
07-28 16:45:21.463: E/AndroidRuntime(1672):     at android.widget.AbsoluteLayout.<init>(AbsoluteLayout.java:52)
07-28 16:45:21.463: E/AndroidRuntime(1672):     at android.webkit.WebView.<init>(WebView.java:498)
07-28 16:45:21.463: E/AndroidRuntime(1672):     at android.webkit.WebView.<init>(WebView.java:475)
07-28 16:45:21.463: E/AndroidRuntime(1672):     at android.webkit.WebView.<init>(WebView.java:455)
07-28 16:45:21.463: E/AndroidRuntime(1672):     at android.webkit.WebView.<init>(WebView.java:444)
07-28 16:45:21.463: E/AndroidRuntime(1672):     at android.webkit.WebView.<init>(WebView.java:434)
07-28 16:45:21.463: E/AndroidRuntime(1672):     at org.apache.cordova.CordovaWebView.<init>(CordovaWebView.java:137)
07-28 16:45:21.463: E/AndroidRuntime(1672):     at org.apache.cordova.CordovaActivity.makeWebView(CordovaActivity.java:314)
07-28 16:45:21.463: E/AndroidRuntime(1672):     at org.apache.cordova.CordovaActivity.init(CordovaActivity.java:349)
07-28 16:45:21.463: E/AndroidRuntime(1672):     at org.MyApp.mMyApp.mMyApp.onCreate(mMyApp.java:31)
07-28 16:45:21.463: E/AndroidRuntime(1672):     at android.app.Activity.performCreate(Activity.java:5242)
07-28 16:45:21.463: E/AndroidRuntime(1672):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
07-28 16:45:21.463: E/AndroidRuntime(1672):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2161)
07-28 16:45:21.463: E/AndroidRuntime(1672):     ... 11 more

Android manifest.xml

<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="1.0.0" android:windowSoftInputMode="adjustPan" package="org.MyApplication.mMyApplication" 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" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <application android:debuggable="true" 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:name="mMyApplication" 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="19" android:targetSdkVersion="20" />
</manifest>

Small script i run for the builds

import os
# run a build for this app
os.system("sencha -d app build -run native");
# change directory into phonegap directory
os.chdir( os.getcwd() + "\phonegap" );
# push the app to the device
os.system("phonegap run android");
print " Script Complete "

解决方案

"is cordovaWebView the same as Chromium" - Yes, it should be. And the most recent version of that doc is here.

Your best bet is to build the Sencha Touch application using the Cordova CLI or Sencha Cmd as all of the WebView setup is automagically done for you.

I'm not entirely sure how to fix your existing setup, but I would definitely encourage you to use one of the two aforementioned CLI tools... it reduces the likelihood of errors like this.

这篇关于Android应用程序无法启动失踪铬的WebView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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