phonegap支持Android 1.6吗?

时间:2012-07-16 07:46:23

标签: android cordova

我正在关注this指南并基于here,它说

  

不要使用旧版Android。使用最高的SDK   目标可用。 Phonegap将负责向后兼容性   对你而言。

所以我使用这些目标:

构建目标

  

Android 2.3.3

  

最低SDK 4

并使用

  

科尔多瓦-1.9.0.jar

但是当我尝试在Android 1.6上运行它时会出现以下错误

E/dalvikvm(200): Could not find method android.webkit.WebView.<init>, referenced from method org.apache.cordova.CordovaWebView.<init>
W/dalvikvm(200): VFY: unable to resolve direct method 285: Landroid/webkit/WebView;.<init> (Landroid/content/Context;Landroid/util/AttributeSet;IZ)V
W/dalvikvm(200): VFY:  rejecting opcode 0x70 at 0x0001
W/dalvikvm(200): VFY:  rejected Lorg/apache/cordova/CordovaWebView;.<init> (Landroid/content/Context;Landroid/util/AttributeSet;IZ)V
W/dalvikvm(200): Verifier rejected class Lorg/apache/cordova/CordovaWebView;
D/AndroidRuntime(200): Shutting down VM
W/dalvikvm(200): threadid=3: thread exiting with uncaught exception (group=0x4001aa28)
E/AndroidRuntime(200): Uncaught handler: thread main exiting due to uncaught exception
E/AndroidRuntime(200): java.lang.VerifyError: org.apache.cordova.CordovaWebView
E/AndroidRuntime(200):  at org.apache.cordova.DroidGap.init(DroidGap.java:297)
E/AndroidRuntime(200):  at org.apache.cordova.DroidGap.loadUrl(DroidGap.java:343)
E/AndroidRuntime(200):  at phone.gap.test.PhonegapTestActivity.onCreate(PhonegapTestActivity.java:13)
E/AndroidRuntime(200):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
E/AndroidRuntime(200):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)
E/AndroidRuntime(200):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)
E/AndroidRuntime(200):  at android.app.ActivityThread.access$2100(ActivityThread.java:116)
E/AndroidRuntime(200):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
E/AndroidRuntime(200):  at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(200):  at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(200):  at android.app.ActivityThread.main(ActivityThread.java:4203)
E/AndroidRuntime(200):  at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(200):  at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime(200):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
E/AndroidRuntime(200):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
E/AndroidRuntime(200):  at dalvik.system.NativeStart.main(Native Method)

然而,当我在Android 2.3.3上运行它时运行良好。 Phonegap不支持Android 1.6吗?

2 个答案:

答案 0 :(得分:0)

由于您使用的是PhoneGap 1.9,请查看:http://docs.phonegap.com/en/1.9.0/guide_cordova-webview_android.md.html#Embedding%20Cordova%20WebView%20on%20Android

虽然支持回到1.6是理想的,但如果你升到2.1,你只会放弃<1%的潜在市场覆盖率。关于这个主题的先前答案也建议使用2.1(minSdkLevel =“7”)作为你的底线。

答案 1 :(得分:0)

PhoneGap 1.0在2.1之前删除了对Android版本的支持。你可以使用0.9.x releases和Android 1.6之一。