我正在尝试使用android volley库发出网络请求:
StringRequest jsObjRequest = new StringRequest(Request.Method.GET,
Network.getFullUrl("/Account/Login"),
new Listener<String>() {
@Override
public void onResponse(String response) {
// TODO Auto-generated method stub
}
}, new ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
// TODO Auto-generated method stub
}
});
Network.getInstance(this).addToRequestQueue(jsObjRequest);
我已将库包含在Projects下的构建路径中。它编译得很好,
但是当我运行应用程序时,我收到以下错误:
08-18 21:57:05.739: E/AndroidRuntime(22937): FATAL EXCEPTION: main
08-18 21:57:05.739: E/AndroidRuntime(22937): java.lang.NoClassDefFoundError: com.android.volley.toolbox.StringRequest
08-18 21:57:05.739: E/AndroidRuntime(22937): at com.fma.mobileapp.LoginActivity.attemptLogin(LoginActivity.java:173)
08-18 21:57:05.739: E/AndroidRuntime(22937): at com.fma.mobileapp.LoginActivity$2.onClick(LoginActivity.java:94)
08-18 21:57:05.739: E/AndroidRuntime(22937): at android.view.View.performClick(View.java:4475)
08-18 21:57:05.739: E/AndroidRuntime(22937): at android.view.View$PerformClick.run(View.java:18786)
08-18 21:57:05.739: E/AndroidRuntime(22937): at android.os.Handler.handleCallback(Handler.java:730)
08-18 21:57:05.739: E/AndroidRuntime(22937): at android.os.Handler.dispatchMessage(Handler.java:92)
08-18 21:57:05.739: E/AndroidRuntime(22937): at android.os.Looper.loop(Looper.java:137)
08-18 21:57:05.739: E/AndroidRuntime(22937): at android.app.ActivityThread.main(ActivityThread.java:5419)
08-18 21:57:05.739: E/AndroidRuntime(22937): at java.lang.reflect.Method.invokeNative(Native Method)
08-18 21:57:05.739: E/AndroidRuntime(22937): at java.lang.reflect.Method.invoke(Method.java:525)
08-18 21:57:05.739: E/AndroidRuntime(22937): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1209)
08-18 21:57:05.739: E/AndroidRuntime(22937): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1025)
08-18 21:57:05.739: E/AndroidRuntime(22937): at dalvik.system.NativeStart.main(Native Method)
[EDIT}
我正在使用最新版本的Android SDK