2

私はこのガイドに従っていて、ここに基づいています、それは言います

古いバージョンのAndroidをわざわざ使用しないでください。利用可能な最高のSDKターゲットを使用します。Phonegapは、下位互換性を処理します。

だから私はこれらのターゲットを使用します:

ターゲットを構築する

Android 2.3.3

最小SDK4

と使用

cordova-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)

ただし、Android2.3.3で実行すると正常に動作します。PhonegapはAndroid1.6をサポートしていませんか?

4

2 に答える 2

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")を使用することも提案されています。

于 2012-07-16T07:58:26.320 に答える
0

PhoneGap 1.0は、2.1より前のAndroidリリースのサポートを削除しました。Android1.6では0.9.xリリースの1つを使用できます。

于 2012-07-16T15:59:59.477 に答える