lundi 28 septembre 2015

AWS API Gateway REST DELETE method call from android app working fine in emulator but not working from device?

I am calling AWS API Gateway REST service from my android app through AsyncTask. All method working fine both in emulator and device. But when I call delete then in emulator working fine but from device it is giving an error that

 java.lang.reflect.UndeclaredThrowableException
09-28 15:32:03.133  12335-12824/com.nrifintech.nmsapp W/System.err﹕ at $Proxy1.userDelete(Native Method)
09-28 15:32:03.133  12335-12824/com.nrifintech.nmsapp W/System.err﹕ at com.nrifintech.nmsapp.CustomUserAdapter$DeleteUsers.doInBackground(CustomUserAdapter.java:130)
09-28 15:32:03.133  12335-12824/com.nrifintech.nmsapp W/System.err﹕ at com.nrifintech.nmsapp.CustomUserAdapter$DeleteUsers.doInBackground(CustomUserAdapter.java:107)
09-28 15:32:03.133  12335-12824/com.nrifintech.nmsapp W/System.err﹕ at android.os.AsyncTask$2.call(AsyncTask.java:288)
09-28 15:32:03.133  12335-12824/com.nrifintech.nmsapp W/System.err﹕ at java.util.concurrent.FutureTask.run(FutureTask.java:237)
09-28 15:32:03.133  12335-12824/com.nrifintech.nmsapp W/System.err﹕ at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
09-28 15:32:03.133  12335-12824/com.nrifintech.nmsapp W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
09-28 15:32:03.133  12335-12824/com.nrifintech.nmsapp W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
09-28 15:32:03.133  12335-12824/com.nrifintech.nmsapp W/System.err﹕ at java.lang.Thread.run(Thread.java:841)
09-28 15:32:03.133  12335-12824/com.nrifintech.nmsapp W/System.err﹕ Caused by: java.net.ProtocolException: DELETE does not support writing
09-28 15:32:03.133  12335-12824/com.nrifintech.nmsapp W/System.err﹕ at com.android.okhttp.internal.http.HttpURLConnectionImpl.initHttpEngine(HttpURLConnectionImpl.java:258)
09-28 15:32:03.133  12335-12824/com.nrifintech.nmsapp W/System.err﹕ at com.android.okhttp.internal.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:86)
09-28 15:32:03.133  12335-12824/com.nrifintech.nmsapp W/System.err﹕ at com.android.okhttp.internal.http.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:197)
09-28 15:32:03.133  12335-12824/com.nrifintech.nmsapp W/System.err﹕ at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:254)
09-28 15:32:03.133  12335-12824/com.nrifintech.nmsapp W/System.err﹕ at com.amazonaws.http.UrlHttpClient.writeContentToConnection(UrlHttpClient.java:128)
09-28 15:32:03.133  12335-12824/com.nrifintech.nmsapp W/System.err﹕ at com.amazonaws.http.UrlHttpClient.execute(UrlHttpClient.java:65)
09-28 15:32:03.133  12335-12824/com.nrifintech.nmsapp W/System.err﹕ at com.amazonaws.mobileconnectors.apigateway.ApiClientHandler.invoke(ApiClientHandler.java:91)

Android Menifest permission are:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />




Aucun commentaire:

Enregistrer un commentaire