Phonegap Cordova 2.0.0全新安装Hello World错误

时间:2012-09-06 15:59:28

标签: android cordova

我已经下载了一份Phonegap / Cordova的新副本,以了解为什么我的应用程序不断出现错误。

我跟随Phonegap的“入门”并最终在我的设备上运行Hello World(HTC DesireHD with Android 2.3.3)。

所以这个应用程序不会这样做,只需在设备上打印hello world。

该应用程序工作很好但是我在日志中收到一些令人不快的错误消息:

具体做法是:

  

09-06 17:26:31.487:E / dalvikvm(32594):找不到上课   'android.webkit.WebResourceResponse',从方法引用   org.apache.cordova.CordovaWebViewClient.generateWebResourceResponse   09-06 17:26:31.487:W / dalvikvm(32594):VFY:无法解决   新实例452(Landroid / webkit / WebResourceResponse;)in   Lorg /阿帕奇/科尔多瓦/ CordovaWebViewClient;

然后我重复了其他相关错误。

我重申该应用程序有效,但我真的不希望在日志中看到任何错误: - )

其他人提到它可能是由于我的libs文件夹的名称(它被正确命名为带有"s"的libs)

我已将AndroidManifest.xmlMainActivity.java和完整LogCat的副本包括在内。

我正在使用Win7,Eclipse 3.8。

非常感谢您的帮助。

的AndroidManifest.xml:

    <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.qwentes.phonegaptest" android:versionCode="1" android:versionName="1.0">
        <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="15" />
        <supports-screens  android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:resizeable="true" android:anyDensity="true" />
        <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" />
        <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme">
            <activity android:name=".MainActivity" android:label="@string/title_activity_main" android:configChanges="orientation|keyboardHidden">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
        </application>
    </manifest>

MainActivity.java

    package com.qwentes.phonegaptest;

    import android.os.Bundle;
    import org.apache.cordova.*;

    public class MainActivity extends DroidGap {

        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            super.loadUrl("file:///android_asset/www/index.html");
        }

    }       

LogCat.txt

    09-06 17:26:29.265: I/dalvikvm(32594): Could not find method android.webkit.WebView.<init>, referenced from method org.apache.cordova.CordovaWebView.<init>
    09-06 17:26:29.265: W/dalvikvm(32594): VFY: unable to resolve direct method 3117: Landroid/webkit/WebView;.<init> (Landroid/content/Context;Landroid/util/AttributeSet;IZ)V
    09-06 17:26:29.265: D/dalvikvm(32594): VFY: replacing opcode 0x70 at 0x0001
    09-06 17:26:29.265: D/dalvikvm(32594): VFY: dead code 0x0004-0059 in Lorg/apache/cordova/CordovaWebView;.<init> (Landroid/content/Context;Landroid/util/AttributeSet;IZ)V
    09-06 17:26:29.705: D/Database(32594): dbopen(): path = /data/data/com.qwentes.phonegaptest/databases/webview.db, flag = 6, cannot stat file, errno: 2,message: No such file or directory
    09-06 17:26:29.705: D/Database(32594): dbopen(): path = /data/data/com.qwentes.phonegaptest/databases/webview.db, mode: delete, disk free size: 554 M, handle: 0x34d960
    09-06 17:26:30.606: V/webviewdatabase(32594): TCP pre connection: creating table in database
    09-06 17:26:30.897: D/Database(32594): dbopen(): path = /data/data/com.qwentes.phonegaptest/databases/webviewCache.db, flag = 6, cannot stat file, errno: 2,message: No such file or directory
    09-06 17:26:30.897: D/Database(32594): dbopen(): path = /data/data/com.qwentes.phonegaptest/databases/webviewCache.db, mode: delete, disk free size: 554 M, handle: 0x372128
    09-06 17:26:31.467: D/skia(32594): htcFlashPlugin::htcFlashPlugin
    09-06 17:26:31.477: D/qct(32594): [WebView.WebView] >> Enable Shutdown = true
    09-06 17:26:31.477: I/CordovaLog(32594): Changing log level to DEBUG(3)
    09-06 17:26:31.477: I/CordovaLog(32594): Found preference for useBrowserHistory=false
    09-06 17:26:31.477: D/CordovaLog(32594): Found preference for useBrowserHistory=false
    09-06 17:26:31.487: E/dalvikvm(32594): Could not find class 'android.webkit.WebResourceResponse', referenced from method org.apache.cordova.CordovaWebViewClient.generateWebResourceResponse
    09-06 17:26:31.487: W/dalvikvm(32594): VFY: unable to resolve new-instance 452 (Landroid/webkit/WebResourceResponse;) in Lorg/apache/cordova/CordovaWebViewClient;
    09-06 17:26:31.487: D/dalvikvm(32594): VFY: replacing opcode 0x22 at 0x0046
    09-06 17:26:31.487: W/dalvikvm(32594): VFY: unable to find class referenced in signature (Landroid/webkit/WebResourceResponse;)
    09-06 17:26:31.487: D/dalvikvm(32594): VFY: dead code 0x0048-004c in Lorg/apache/cordova/CordovaWebViewClient;.generateWebResourceResponse (Ljava/lang/String;)Landroid/webkit/WebResourceResponse;
    09-06 17:26:31.527: W/dalvikvm(32594): VFY: unable to find class referenced in signature (Landroid/webkit/WebResourceResponse;)
    09-06 17:26:31.527: W/dalvikvm(32594): VFY: unable to find class referenced in signature (Landroid/webkit/WebResourceResponse;)
    09-06 17:26:31.527: I/dalvikvm(32594): Could not find method android.webkit.WebViewClient.shouldInterceptRequest, referenced from method org.apache.cordova.CordovaWebViewClient.shouldInterceptRequest
    09-06 17:26:31.527: W/dalvikvm(32594): VFY: unable to resolve virtual method 3129: Landroid/webkit/WebViewClient;.shouldInterceptRequest (Landroid/webkit/WebView;Ljava/lang/String;)Landroid/webkit/WebResourceResponse;
    09-06 17:26:31.527: D/dalvikvm(32594): VFY: replacing opcode 0x6f at 0x0015
    09-06 17:26:31.527: D/dalvikvm(32594): VFY: dead code 0x0018-0019 in Lorg/apache/cordova/CordovaWebViewClient;.shouldInterceptRequest (Landroid/webkit/WebView;Ljava/lang/String;)Landroid/webkit/WebResourceResponse;
    09-06 17:26:31.527: D/DroidGap(32594): DroidGap.init()
    09-06 17:26:31.547: D/CordovaWebView(32594): >>> loadUrl(file:///android_asset/www/index.html)
    09-06 17:26:31.547: D/PluginManager(32594): init()
    09-06 17:26:31.547: D/CordovaWebView(32594): >>> loadUrlNow()
    09-06 17:26:31.587: D/ATRecorder(32594): com.htc.autotest.dlib.RecordEngine in loader dalvik.system.DexClassLoader@4053e810
    09-06 17:26:31.597: D/WindowManagerImpl(32594): addView, new view, mViews[0]: com.android.internal.policy.impl.PhoneWindow$DecorView@4053ada8
    09-06 17:26:31.597: D/SoftKeyboardDetect(32594): Ignore this event
    09-06 17:26:31.687: W/webcore(32594): Not supported in this case.
    09-06 17:26:31.687: D/SoftKeyboardDetect(32594): Ignore this event
    09-06 17:26:31.817: D/qct(32594): [RequestQueue.ActivePool.ActivePool] >> Enable Shutdown = true
    09-06 17:26:31.817: D/qct(32594): [IdleCache.IdleCache] >> IDLE_CACHE_MAX = 40
    09-06 17:26:32.418: D/DroidGap(32594): onMessage(onPageStarted,file:///android_asset/www/index.html)
    09-06 17:26:32.558: D/szipinf(32594): Initializing inflate state
    09-06 17:26:32.558: D/szipinf(32594): Initializing zlib to inflate
    09-06 17:26:32.618: D/webkit-timers(32594): [JWebCoreJavaBridge::resume] >> do resume
    09-06 17:26:32.738: D/dalvikvm(32594): GC_CONCURRENT freed 134K, 44% free 3208K/5639K, external 0K/0K, paused 2ms+20ms
    09-06 17:26:33.729: D/Cordova(32594): onPageFinished(file:///android_asset/www/index.html)
    09-06 17:26:33.729: D/CordovaWebView(32594): >>> loadUrlNow()
    09-06 17:26:33.729: D/DroidGap(32594): onMessage(onNativeReady,null)
    09-06 17:26:33.729: D/DroidGap(32594): onMessage(onPageFinished,file:///android_asset/www/index.html)
    09-06 17:26:34.030: I/Database(32594): sqlite returned: error code = 14, msg = cannot open file at line 27206 of [42537b6056]
    09-06 17:26:34.190: D/DroidGap(32594): onMessage(networkconnection,wifi)
    09-06 17:26:34.230: D/DroidGap(32594): onMessage(spinner,stop)
    09-06 17:26:35.741: D/DroidGap(32594): onMessage(spinner,stop)
    09-06 17:26:44.430: D/dalvikvm(32594): GC_CONCURRENT freed 376K, 46% free 3284K/6023K, external 0K/0K, paused 2ms+3ms
    09-06 17:27:34.619: D/dalvikvm(32594): GC_FOR_MALLOC freed 586K, 50% free 3133K/6151K, external 0K/0K, paused 43ms
    09-06 17:28:04.808: D/dalvikvm(32594): GC_CONCURRENT freed 357K, 48% free 3208K/6151K, external 0K/0K, paused 6ms+3ms

1 个答案:

答案 0 :(得分:0)

对于2.0.0中的那些令人讨厌的日志,你无能为力,但是它们将在2.1.0中消失,这应该在一周内消失。它们由此提交修复:

https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-android.git;a=commit;h=07439ff99ca5f61c444ae7673d9fec96e4502492