我正在尝试使用 cordova 2.2 版本获取设备的联系人。当我在模拟器中运行应用程序时,它显示应用程序已意外停止。logcat 显示以下错误。
08-21 19:04:27.999: E/AndroidRuntime(4650): FATAL EXCEPTION: main
08-21 19:04:27.999: E/AndroidRuntime(4650): java.lang.SecurityException:
ConnectivityService: Neither user 10035 nor current process has android.permission.ACCESS_NETWORK_STATE.
08-21 19:04:27.999: E/AndroidRuntime(4650): at android.os.Parcel.readException(Parcel.java:1322)
08-21 19:04:27.999: E/AndroidRuntime(4650): at android.os.Parcel.readException(Parcel.java:1276)
08-21 19:04:27.999: E/AndroidRuntime(4650): at android.net.IConnectivityManager$Stub$Proxy.getActiveNetworkInfo(IConnectivityManager.java:345)
08-21 19:04:27.999: E/AndroidRuntime(4650): at android.net.ConnectivityManager.getActiveNetworkInfo(ConnectivityManager.java:251)
08-21 19:04:27.999: E/AndroidRuntime(4650): at org.apache.cordova.NetworkManager.execute(NetworkManager.java:127)
08-21 19:04:27.999: E/AndroidRuntime(4650): at org.apache.cordova.api.CordovaPlugin.execute(CordovaPlugin.java:61)
08-21 19:04:27.999: E/AndroidRuntime(4650): at org.apache.cordova.api.PluginManager.exec(PluginManager.java:224)
08-21 19:04:27.999: E/AndroidRuntime(4650): at org.apache.cordova.ExposedJsApi.exec(ExposedJsApi.java:43)
08-21 19:04:27.999: E/AndroidRuntime(4650): at org.apache.cordova.CordovaChromeClient.onJsPrompt(CordovaChromeClient.java:213)
08-21 19:04:27.999: E/AndroidRuntime(4650): at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:566)
08-21 19:04:27.999: E/AndroidRuntime(4650): at android.os.Handler.dispatchMessage(Handler.java:99)
08-21 19:04:27.999: E/AndroidRuntime(4650): at android.os.Looper.loop(Looper.java:123)
08-21 19:04:27.999: E/AndroidRuntime(4650): at android.app.ActivityThread.main(ActivityThread.java:3683)
08-21 19:04:27.999: E/AndroidRuntime(4650): at java.lang.reflect.Method.invokeNative(Native Method)
08-21 19:04:27.999: E/AndroidRuntime(4650): at java.lang.reflect.Method.invoke(Method.java:507)
08-21 19:04:27.999: E/AndroidRuntime(4650): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
08-21 19:04:27.999: E/AndroidRuntime(4650): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
08-21 19:04:27.999: E/AndroidRuntime(4650): at dalvik.system.NativeStart.main(Native Method)