VolleyPlus icon indicating copy to clipboard operation
VolleyPlus copied to clipboard

anonymous class derived from ErrorListener must either be declared abstract or implement abstract method onErrorResponse(VolleyError error) in ErrorListener

Open adimitorv opened this issue 8 years ago • 5 comments

 JSONObject jsonParams = new JSONObject(params);
        final JsonObjectRequest jsObjRequest = new JsonObjectRequest(context, Request.Method.POST, SERVER_URL, jsonParams, new Response.Listener<JSONObject>() {
            @Override
            public void onResponse(JSONObject response) {
                Log.d("deletePost", "response: " + response);
            }
        }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError error) {
                Log.e("deletePost", "error: " + error);
            }
        });

        VolleySingleton.getInstance(context).addToRequestQueue(jsObjRequest);

This is the error I'm getting from Androdi Studio, I can compile and run it without a problem: anonymous class derived from ErrorListener must either be declared abstract or implement abstract method onErrorResponse(VolleyError error) in ErrorListener

adimitorv avatar Jul 15 '16 12:07 adimitorv

Do you have another module bringing in a Volley dependency by any chance?

shaharyakir avatar Jan 25 '17 07:01 shaharyakir

Hi .. I'm having the same issue and yea I have another dependency for Volley. In my build.gradle I got :

compile 'com.android.volley:volley:1.0.0' compile 'dev.dworks.libs:volleyplus:+'

The fact is I can't use only the first one since I need the SimpleMultiPartRequest class for uploading a video file. At the same time I can't use only the second one since I 'm using the basic Volley JsonObjectRequest for basic http requests when logging the user ...

Any clue on how to workout this issue ??

Saatch avatar Apr 18 '17 12:04 Saatch

@Saatch me too getting this issue. any workaround ?

qadir227 avatar Jun 11 '17 11:06 qadir227

@Saatch just remove compile 'com.android.volley:volley:1.0.0' from your dependence and sync again. It seems VolleyPlus has all the functionality on Volley:1.0.0 library (as name suggests)

This should be mentioned in Docs/Read.me file

qadir227 avatar Jun 11 '17 11:06 qadir227

@qadir227 Yea I figured that out recently... I tried to use Volleyplus only for multipart video uploading requests but then I changed all my other normal volley requests to Volleyplus since they re conflicting each other and removed the dependency ... it solved the problem

Saatch avatar Jun 11 '17 12:06 Saatch