2012-07-16 148 views
2

我下面this指南和基於here,它說Phonegap是否支持Android 1.6?

不要打擾使用舊版本的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嗎?

+0

你在droidgap.loadurl()中加載了哪些url? – Ponmalar 2012-07-16 08:06:54

+0

我正在加載文件:///android_asses/www/index.html,並有資產內的html文件 - > www文件夾 – Rendy 2012-07-16 08:42:47

回答

0

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

+0

是否有可能有2個版本jar和js在一個項目上? – Rendy 2012-07-18 08:12:47

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,你只能放棄你的潛在市場< 1%,如果你移動到達最高2.1。先前有關此主題的答案也建議使用2.1(minSdkLevel =「7」)作爲底端。

+0

似乎沒有運氣......哪個主題?我知道我只有非常小的1.6版本的市場,但我仍然需要使它爲Android 1.6 :( – Rendy 2012-07-16 08:45:50

+0

對不起,我可以提供更多我不使用PhoneGap我自己。 – Sparky 2012-07-16 08:52:46

+0

沒問題..感謝您的努力幫我:) – Rendy 2012-07-16 08:55:10