• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Value Villa of type java.lang.String cannot be converted to JSONObjec

i am facing a problem i use created a php script to take some values from my server , and send it with JSON to my application. Now i tried to take the result from my JSON in my Java code but i had this message VALUE Villa OF TYPE JAVA.LANG.STRING CANNOT BE CONVERTED TO JSONOBJECT please help

Code:
[LIST=1]
[*]package com.example.tantine1.housefindpro;
[*]

[*]import android.app.Activity;
[*]import android.content.Intent;
[*]import android.os.AsyncTask;
[*]import android.os.Bundle;
[*]import android.support.v7.app.AppCompatActivity;
[*]import android.support.v7.widget.LinearLayoutManager;
[*]import android.support.v7.widget.RecyclerView;
[*]import android.util.Log;
[*]import android.view.MotionEvent;
[*]import android.view.View;
[*]import android.widget.ProgressBar;
[*]import android.widget.Toast;
[*]

[*]import org.json.JSONArray;
[*]import org.json.JSONException;
[*]import org.json.JSONObject;
[*]

[*]import java.io.BufferedReader;
[*]import java.io.BufferedWriter;
[*]import java.io.IOException;
[*]import java.io.InputStreamReader;
[*]import java.io.OutputStream;
[*]import java.io.OutputStreamWriter;
[*]import java.io.UnsupportedEncodingException;
[*]import java.net.HttpURLConnection;
[*]import java.net.MalformedURLException;
[*]import java.net.URL;
[*]import java.net.URLDecoder;
[*]import java.util.ArrayList;
[*]import java.util.List;
[*]

[*]/**
[*]* Created by Tantine1 on 4/28/2016.
[*]*/
[*]public class consulAffiche extends AppCompatActivity{
[*]    /**
[*]     * @param savedInstanceState
[*]     * ici on affiche les maison a louer de moins detailler
[*]     */
[*]    private static final String TAG="RecyclerViewExample";
[*]    String tabTypeVille [];
[*]    RecyclerView recyclerView;
[*]    globalVars globalVars = new globalVars();
[*]    String json_string=globalVars.getUrl()+"consulAfficheMaison.php";
[*]    ProgressBar progressBar;
[*]    MyRecyclerAdapterConsul adapter;
[*]    /**
[*]     * Changer sa en maison après
[*]     */
[*]    private List<Maison> feedsList;
[*]

[*]    protected void onCreate(Bundle savedInstanceState){
[*]        super.onCreate(savedInstanceState);
[*]        setContentView(R.layout.consulaffiche);
[*]

[*]        //Récupération du tableau venant de ConsulPrincipal avec le type et ville selectionner
[*]        Intent intent = this.getIntent();
[*]        tabTypeVille = intent.getStringArrayExtra("tableauValeur");
[*]

[*]        Log.i("type",tabTypeVille[0]);
[*]        Log.i("ville",tabTypeVille[1]);
[*]

[*]        recyclerView = (RecyclerView)findViewById(R.id.my_recycler_view);
[*]

[*]        //Layout manager for Recycler view
[*]        recyclerView.setLayoutManager(new LinearLayoutManager(this));
[*]

[*]        progressBar = (ProgressBar)findViewById(R.id.progress_bar);
[*]        progressBar.setVisibility(View.VISIBLE);
[*]

[*]        //Downloading data from below url
[*]        AsyncHttpTask as =  new AsyncHttpTask();
[*]       as.execute(json_string);
[*]

[*]    }
[*]

[*]    public class AsyncHttpTask extends AsyncTask<String, Void, Integer>{
[*]        Integer result;
[*]        @Override
[*]        protected void onPreExecute() {
[*]          setProgressBarIndeterminate(true);
[*]        }
[*]

[*]        @Override
[*]        protected Integer doInBackground(String... params) {
[*]            result = 0;
[*]            HttpURLConnection urlConnection;
[*]

[*]            try {
[*]                URL url = new URL(params[0]);
[*]                urlConnection = (HttpURLConnection)url.openConnection();
[*]                int statusCode = urlConnection.getResponseCode();
[*]                    Log.i("statusI", String.valueOf(statusCode));
[*]                //200 represents HTTP Ok
[*]                if(statusCode==200){
[*]                    BufferedReader r = new BufferedReader(new InputStreamReader(urlConnection.getInputStream(),"utf-8"));
[*]                    StringBuilder response = new StringBuilder();
[*]                    String line;
[*]                    while((line=r.readLine())!=null){
[*]                        response.append(line);
[*]                    }
[*]                   // Log.i("response",response.toString());
[*]                    Log.i("arnaud", "test");
[*]                    parseResult(String.valueOf(response));
[*]                    result=1; // Successful
[*]                }else {
[*]                    result = 0; //Failed to fetch data!
[*]                }
[*]

[*]            }catch (Exception e){
[*]                Log.d(TAG,e.getLocalizedMessage());
[*]            }
[*]

[*]            return result;
[*]        }
[*]

[*]        @Override
[*]        protected void onPostExecute(Integer integer) {
[*]

[*]            //Download complete. let us update UI
[*]            progressBar.setVisibility(View.GONE);
[*]

[*]            if(result==1){
[*]                adapter = new MyRecyclerAdapterConsul(getApplicationContext(),feedsList);
[*]                recyclerView.setAdapter(adapter);
[*]            }else{
[*]                Toast.makeText(consulAffiche.this,"Failed to fetch data!",Toast.LENGTH_SHORT).show();
[*]            }
[*]        }
[*]    }
[*]

[*]    private void parseResult(String result){
[*]        Maison item;
[*]        String st;
[*]

[*]

[*]

[*]

[*]

[*]

[*]        try {
[*]            JSONObject response = new JSONObject(result);
[*]            JSONArray jsonArray = response.getJSONArray("server_response");
[*]            int count = 0;
[*]

[*]            while (count<jsonArray.length()){
[*]                JSONObject jo = jsonArray.getJSONObject(count);
[*]                count++;
[*]                item = new Maison();
[*]                item.setQuartier(jo.getString("quartier"));
[*]

[*]

[*]            }
[*]        } catch (JSONException e) {
[*]            e.printStackTrace();
[*]            Log.i("arnaud0",e.getMessage());
[*]        }
[*]

[*]

[*]        //JSONArray posts = response.optJSONArray("server_response");
[*]        feedsList = new ArrayList<>();
[*]        // Log.i("arnaud1",posts.getString() );
[*]          /*  for(int i=0;i<posts.length();i++){
[*]                JSONObject post = posts.optJSONObject(i);
[*]                item = new Maison();
[*]

[*]                item.setQuartier(post.optString("quartier"));
[*]                item.setPrix(post.optString("prix"));
[*]                item.setDescription(post.optString("description"));
[*]                item.setEtat(post.optString("etat"));
[*]                item.setTel_bayeur(post.optString("tel_bayeur"));
[*]

[*]                feedsList.add(item);
[*]            }*/
[*]

[*]

[*]    }
[*]

[*]

[*]}
[*]

[*]

[*]
[/LIST]
 
Last edited:
voici mon code
Code:
package com.example.tantine1.housefindpro;

import android.app.Activity;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ProgressBar;
import android.widget.Toast;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.List;

/**
* Created by Tantine1 on 4/28/2016.
*/
public class consulAffiche extends AppCompatActivity{
    /**
     * @param savedInstanceState
     * ici on affiche les maison a louer de moins detailler
     */
    private static final String TAG="RecyclerViewExample";
    String tabTypeVille [];
    RecyclerView recyclerView;
    globalVars globalVars = new globalVars();
    String json_string=globalVars.getUrl()+"consulAfficheMaison.php";
    ProgressBar progressBar;
    MyRecyclerAdapterConsul adapter;
    /**
     * Changer sa en maison après
     */
    private List<Maison> feedsList;

    protected void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        setContentView(R.layout.consulaffiche);

        //Récupération du tableau venant de ConsulPrincipal avec le type et ville selectionner
        Intent intent = this.getIntent();
        tabTypeVille = intent.getStringArrayExtra("tableauValeur");

        Log.i("type",tabTypeVille[0]);
        Log.i("ville",tabTypeVille[1]);

        recyclerView = (RecyclerView)findViewById(R.id.my_recycler_view);

        //Layout manager for Recycler view
        recyclerView.setLayoutManager(new LinearLayoutManager(this));

        progressBar = (ProgressBar)findViewById(R.id.progress_bar);
        progressBar.setVisibility(View.VISIBLE);

        //Downloading data from below url
        AsyncHttpTask as =  new AsyncHttpTask();
       as.execute(json_string);

    }

    public class AsyncHttpTask extends AsyncTask<String, Void, Integer>{
        Integer result;
        @Override
        protected void onPreExecute() {
          setProgressBarIndeterminate(true);
        }

        @Override
        protected Integer doInBackground(String... params) {
            result = 0;
            HttpURLConnection urlConnection;

            try {
                URL url = new URL(params[0]);
                urlConnection = (HttpURLConnection)url.openConnection();
                int statusCode = urlConnection.getResponseCode();
                    Log.i("statusI", String.valueOf(statusCode));
                //200 represents HTTP Ok
                if(statusCode==200){
                    BufferedReader r = new BufferedReader(new InputStreamReader(urlConnection.getInputStream(),"utf-8"));
                    StringBuilder response = new StringBuilder();
                    String line;
                    while((line=r.readLine())!=null){
                        response.append(line);
                    }
                   // Log.i("response",response.toString());
                    Log.i("arnaud", "test");
                    parseResult(String.valueOf(response));
                    result=1; // Successful
                }else {
                    result = 0; //Failed to fetch data!
                }

            }catch (Exception e){
                Log.d(TAG,e.getLocalizedMessage());
            }

            return result;
        }

        @Override
        protected void onPostExecute(Integer integer) {

            //Download complete. let us update UI
            progressBar.setVisibility(View.GONE);

            if(result==1){
                adapter = new MyRecyclerAdapterConsul(getApplicationContext(),feedsList);
                recyclerView.setAdapter(adapter);
            }else{
                Toast.makeText(consulAffiche.this,"Failed to fetch data!",Toast.LENGTH_SHORT).show();
            }
        }
    }

    private void parseResult(String result){
        Maison item;
        String st;






        try {
            JSONObject response = new JSONObject(result);
            JSONArray jsonArray = response.getJSONArray("server_response");
            int count = 0;

            while (count<jsonArray.length()){
                JSONObject jo = jsonArray.getJSONObject(count);
                count++;
                item = new Maison();
                item.setQuartier(jo.getString("quartier"));


            }
        } catch (JSONException e) {
            e.printStackTrace();
            Log.i("arnaud0",e.getMessage());
        }


        //JSONArray posts = response.optJSONArray("server_response");
        feedsList = new ArrayList<>();
        // Log.i("arnaud1",posts.getString() );
          /*  for(int i=0;i<posts.length();i++){
                JSONObject post = posts.optJSONObject(i);
                item = new Maison();

                item.setQuartier(post.optString("quartier"));
                item.setPrix(post.optString("prix"));
                item.setDescription(post.optString("description"));
                item.setEtat(post.optString("etat"));
                item.setTel_bayeur(post.optString("tel_bayeur"));

                feedsList.add(item);
            }*/


    }


}


[code]
 
the complete logcat is
Code:
06-29 08:22:46.642 26123-26123/com.example.tantine1.housefindpro I/type: ******************
06-29 08:22:46.642 26123-26123/com.example.tantine1.housefindpro I/ville: Abong-Mbang
06-29 08:22:46.678 26123-26123/com.example.tantine1.housefindpro E/RecyclerView: No adapter attached; skipping layout
06-29 08:22:46.700 26123-28887/com.example.tantine1.housefindpro I/statusI: 200
06-29 08:22:46.715 26123-28887/com.example.tantine1.housefindpro I/arnaud: test
06-29 08:22:46.716 26123-28887/com.example.tantine1.housefindpro W/System.err: org.json.JSONException: Value Villa of type java.lang.String cannot be converted to JSONObject
06-29 08:22:46.717 26123-26123/com.example.tantine1.housefindpro E/RecyclerView: No adapter attached; skipping layout
06-29 08:22:46.733 26123-28887/com.example.tantine1.housefindpro W/System.err:     at org.json.JSON.typeMismatch(JSON.java:111)
06-29 08:22:46.734 26123-28887/com.example.tantine1.housefindpro W/System.err:     at org.json.JSONObject.<init>(JSONObject.java:159)
06-29 08:22:46.735 26123-28887/com.example.tantine1.housefindpro W/System.err:     at org.json.JSONObject.<init>(JSONObject.java:172)
06-29 08:22:46.735 26123-28887/com.example.tantine1.housefindpro W/System.err:     at com.example.tantine1.housefindpro.consulAffiche.parseResult(consulAffiche.java:142)
06-29 08:22:46.735 26123-28887/com.example.tantine1.housefindpro W/System.err:     at com.example.tantine1.housefindpro.consulAffiche.access$000(consulAffiche.java:37)
06-29 08:22:46.735 26123-28887/com.example.tantine1.housefindpro W/System.err:     at com.example.tantine1.housefindpro.consulAffiche$AsyncHttpTask.doInBackground(consulAffiche.java:106)
06-29 08:22:46.735 26123-28887/com.example.tantine1.housefindpro W/System.err:     at com.example.tantine1.housefindpro.consulAffiche$AsyncHttpTask.doInBackground(consulAffiche.java:79)
06-29 08:22:46.735 26123-28887/com.example.tantine1.housefindpro W/System.err:     at android.os.AsyncTask$2.call(AsyncTask.java:288)
06-29 08:22:46.736 26123-28887/com.example.tantine1.housefindpro W/System.err:     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
06-29 08:22:46.737 26123-28887/com.example.tantine1.housefindpro W/System.err:     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
06-29 08:22:46.737 26123-28887/com.example.tantine1.housefindpro W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
06-29 08:22:46.737 26123-28887/com.example.tantine1.housefindpro W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
06-29 08:22:46.738 26123-28887/com.example.tantine1.housefindpro W/System.err:     at java.lang.Thread.run(Thread.java:841)
06-29 08:22:46.738 26123-28887/com.example.tantine1.housefindpro I/JsonErreur:: Value Villa of type java.lang.String cannot be converted to JSONObject
 
The stack trace doesn't appear to match the code. Where is line 142?

Code:
06-29 08:22:46.735 26123-28887/com.example.tantine1.housefindpro W/System.err:     at com.example.tantine1.housefindpro.consulAffiche.parseResult(consulAffiche.java:142)
 
sorry it was the logcat while i was debugging it.
This is the logcat for the code i send you....
Code:
06-29 08:46:57.695 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.content.Context.getSystemService, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.695 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 477: Landroid/content/Context;.getSystemService (Ljava/lang/Class;)Ljava/lang/Object;
06-29 08:46:57.696 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.app.Activity.stopLockTask, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.697 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 267: Landroid/app/Activity;.stopLockTask ()V
06-29 08:46:57.697 23590-23590/com.example.tantine1.housefindpro E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.698 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve check-cast 232 (Landroid/os/PersistableBundle;) in Lcom/example/tantine1/housefindpro/consulAffiche;
06-29 08:46:57.698 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.content.Context.getColorStateList, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.698 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 460: Landroid/content/Context;.getColorStateList (I)Landroid/content/res/ColorStateList;
06-29 08:46:57.698 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.app.Activity.onVisibleBehindCanceled, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.699 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 187: Landroid/app/Activity;.onVisibleBehindCanceled ()V
06-29 08:46:57.699 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.app.Activity.onWindowStartingActionMode, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.699 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 191: Landroid/app/Activity;.onWindowStartingActionMode (Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode;
06-29 08:46:57.700 23590-23590/com.example.tantine1.housefindpro E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.700 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve check-cast 232 (Landroid/os/PersistableBundle;) in Lcom/example/tantine1/housefindpro/consulAffiche;
06-29 08:46:57.700 23590-23590/com.example.tantine1.housefindpro E/dalvikvm: Could not find class 'android.media.session.MediaController', referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.700 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve check-cast 190 (Landroid/media/session/MediaController;) in Lcom/example/tantine1/housefindpro/consulAffiche;
06-29 08:46:57.701 23590-23590/com.example.tantine1.housefindpro E/dalvikvm: Could not find class 'android.widget.Toolbar', referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.701 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve check-cast 2109 (Landroid/widget/Toolbar;) in Lcom/example/tantine1/housefindpro/consulAffiche;
06-29 08:46:57.703 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.app.Activity.releaseInstance, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.706 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 198: Landroid/app/Activity;.releaseInstance ()Z
06-29 08:46:57.707 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.app.Activity.onActivityReenter, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.708 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 114: Landroid/app/Activity;.onActivityReenter (ILandroid/content/Intent;)V
06-29 08:46:57.708 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.content.ContextWrapper.getCodeCacheDir, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.708 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 529: Landroid/content/ContextWrapper;.getCodeCacheDir ()Ljava/io/File;
06-29 08:46:57.709 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v4/app/FragmentActivity;.dispatchFragmentsOnCreateView (Landroid/view/View;Ljava/lang/String;Landroid/content/Context;Landroid/util/AttributeSet;)Landroid/view/View; from Lcom/example/tantine1/housefindpro/consulAffiche;)
06-29 08:46:57.709 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.support.v4.app.FragmentActivity.dispatchFragmentsOnCreateView, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.709 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 2372: Landroid/support/v4/app/FragmentActivity;.dispatchFragmentsOnCreateView (Landroid/view/View;Ljava/lang/String;Landroid/content/Context;Landroid/util/AttributeSet;)Landroid/view/View;
06-29 08:46:57.710 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.app.Activity.getVoiceInteractor, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.710 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 93: Landroid/app/Activity;.getVoiceInteractor ()Landroid/app/VoiceInteractor;
06-29 08:46:57.711 23590-23590/com.example.tantine1.housefindpro E/dalvikvm: Could not find class 'android.app.ActivityManager$TaskDescription', referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.711 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve check-cast 26 (Landroid/app/ActivityManager$TaskDescription;) in Lcom/example/tantine1/housefindpro/consulAffiche;
06-29 08:46:57.711 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.app.Activity.startActionMode, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.711 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 242: Landroid/app/Activity;.startActionMode (Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode;
06-29 08:46:57.712 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.app.Activity.showAssist, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.712 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 237: Landroid/app/Activity;.showAssist (Landroid/os/Bundle;)Z
06-29 08:46:57.712 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.app.Activity.postponeEnterTransition, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.712 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 195: Landroid/app/Activity;.postponeEnterTransition ()V
06-29 08:46:57.713 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.content.ContextWrapper.getNoBackupFilesDir, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.713 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 541: Landroid/content/ContextWrapper;.getNoBackupFilesDir ()Ljava/io/File;
06-29 08:46:57.714 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.app.Activity.requestPermissions, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.714 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 201: Landroid/app/Activity;.requestPermissions ([Ljava/lang/String;I)V
06-29 08:46:57.715 23590-23590/com.example.tantine1.housefindpro E/dalvikvm: Could not find class 'android.app.SharedElementCallback', referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.715 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve check-cast 52 (Landroid/app/SharedElementCallback;) in Lcom/example/tantine1/housefindpro/consulAffiche;
06-29 08:46:57.715 23590-23590/com.example.tantine1.housefindpro E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.715 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve check-cast 232 (Landroid/os/PersistableBundle;) in Lcom/example/tantine1/housefindpro/consulAffiche;
06-29 08:46:57.716 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: DexOpt: resolve class illegal access: Lcom/example/tantine1/housefindpro/consulAffiche; -> Landroid/support/v4/app/BaseFragmentActivityDonut;
06-29 08:46:57.716 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.support.v4.app.BaseFragmentActivityDonut.onCreateView, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.716 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 2148: Landroid/support/v4/app/BaseFragmentActivityDonut;.onCreateView (Ljava/lang/String;Landroid/content/Context;Landroid/util/AttributeSet;)Landroid/view/View;
06-29 08:46:57.717 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.app.Activity.setContentTransitionManager, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.717 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 206: Landroid/app/Activity;.setContentTransitionManager (Landroid/transition/TransitionManager;)V
06-29 08:46:57.717 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.app.Activity.onProvideReferrer, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.718 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 167: Landroid/app/Activity;.onProvideReferrer ()Landroid/net/Uri;
06-29 08:46:57.718 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v4/app/FragmentActivity;.doReallyStop (Z)V from Lcom/example/tantine1/housefindpro/consulAffiche;)
06-29 08:46:57.718 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.support.v4.app.FragmentActivity.doReallyStop, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.718 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 2374: Landroid/support/v4/app/FragmentActivity;.doReallyStop (Z)V
06-29 08:46:57.722 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.content.Context.getDrawable, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.722 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 462: Landroid/content/Context;.getDrawable (I)Landroid/graphics/drawable/Drawable;
06-29 08:46:57.722 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.app.Activity.showLockTaskEscapeMessage, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.723 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 240: Landroid/app/Activity;.showLockTaskEscapeMessage ()V
06-29 08:46:57.723 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.app.Activity.getContentTransitionManager, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.723 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 68: Landroid/app/Activity;.getContentTransitionManager ()Landroid/transition/TransitionManager;
06-29 08:46:57.724 23590-23590/com.example.tantine1.housefindpro E/dalvikvm: Could not find class 'android.app.SharedElementCallback', referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.724 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve check-cast 52 (Landroid/app/SharedElementCallback;) in Lcom/example/tantine1/housefindpro/consulAffiche;
06-29 08:46:57.725 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.app.Activity.getReferrer, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.725 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 83: Landroid/app/Activity;.getReferrer ()Landroid/net/Uri;
06-29 08:46:57.725 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.content.ContextWrapper.getSystemServiceName, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.725 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 550: Landroid/content/ContextWrapper;.getSystemServiceName (Ljava/lang/Class;)Ljava/lang/String;
06-29 08:46:57.726 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.app.Activity.isVoiceInteractionRoot, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.726 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 106: Landroid/app/Activity;.isVoiceInteractionRoot ()Z
06-29 08:46:57.727 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.content.ContextWrapper.getExternalMediaDirs, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.727 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 537: Landroid/content/ContextWrapper;.getExternalMediaDirs ()[Ljava/io/File;
06-29 08:46:57.728 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.app.Activity.getMediaController, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.728 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 76: Landroid/app/Activity;.getMediaController ()Landroid/media/session/MediaController;
06-29 08:46:57.728 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.app.Activity.getSearchEvent, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.728 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 86: Landroid/app/Activity;.getSearchEvent ()Landroid/view/SearchEvent;
06-29 08:46:57.729 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v4/app/FragmentActivity;.onReallyStop ()V from Lcom/example/tantine1/housefindpro/consulAffiche;)
06-29 08:46:57.729 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.support.v4.app.FragmentActivity.onReallyStop, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.729 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 2409: Landroid/support/v4/app/FragmentActivity;.onReallyStop ()V
06-29 08:46:57.730 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.app.Activity.isVoiceInteraction, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.730 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 105: Landroid/app/Activity;.isVoiceInteraction ()Z
06-29 08:46:57.730 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.app.Activity.requestVisibleBehind, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.730 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 202: Landroid/app/Activity;.requestVisibleBehind (Z)Z
06-29 08:46:57.731 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.app.Activity.shouldShowRequestPermissionRationale, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.731 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 235: Landroid/app/Activity;.shouldShowRequestPermissionRationale (Ljava/lang/String;)Z
06-29 08:46:57.731 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.app.Activity.finishAndRemoveTask, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.731 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 58: Landroid/app/Activity;.finishAndRemoveTask ()V
06-29 08:46:57.732 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.content.Context.getColor, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.732 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 459: Landroid/content/Context;.getColor (I)I
06-29 08:46:57.733 23590-23590/com.example.tantine1.housefindpro E/dalvikvm: Could not find class 'android.app.assist.AssistContent', referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.733 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve check-cast 56 (Landroid/app/assist/AssistContent;) in Lcom/example/tantine1/housefindpro/consulAffiche;
06-29 08:46:57.734 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.app.Activity.finishAfterTransition, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.734 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 57: Landroid/app/Activity;.finishAfterTransition ()V
06-29 08:46:57.734 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.app.Activity.getContentScene, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.734 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 67: Landroid/app/Activity;.getContentScene ()Landroid/transition/Scene;
06-29 08:46:57.737 23590-23590/com.example.tantine1.housefindpro E/dalvikvm: Could not find class 'android.view.SearchEvent', referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.737 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve check-cast 1987 (Landroid/view/SearchEvent;) in Lcom/example/tantine1/housefindpro/consulAffiche;
06-29 08:46:57.737 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: DexOpt: resolve class illegal access: Lcom/example/tantine1/housefindpro/consulAffiche; -> Landroid/support/v4/app/BaseFragmentActivityHoneycomb;
06-29 08:46:57.737 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.support.v4.app.BaseFragmentActivityHoneycomb.onCreateView, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.737 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 2155: Landroid/support/v4/app/BaseFragmentActivityHoneycomb;.onCreateView (Landroid/view/View;Ljava/lang/String;Landroid/content/Context;Landroid/util/AttributeSet;)Landroid/view/View;
06-29 08:46:57.738 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.app.Activity.startLockTask, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.738 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 261: Landroid/app/Activity;.startLockTask ()V
06-29 08:46:57.739 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.content.ContextWrapper.checkSelfPermission, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.739 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 505: Landroid/content/ContextWrapper;.checkSelfPermission (Ljava/lang/String;)I
06-29 08:46:57.741 23590-23590/com.example.tantine1.housefindpro E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.741 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve check-cast 232 (Landroid/os/PersistableBundle;) in Lcom/example/tantine1/housefindpro/consulAffiche;
06-29 08:46:57.741 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.app.Activity.startPostponedEnterTransition, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.741 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 265: Landroid/app/Activity;.startPostponedEnterTransition ()V
06-29 08:46:57.743 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.app.Activity.onEnterAnimationComplete, referenced from method com.example.tantine1.housefindpro.consulAffiche.access$super
06-29 08:46:57.743 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 140: Landroid/app/Activity;.onEnterAnimationComplete ()V
06-29 08:46:57.761 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/view/SearchEvent;)
06-29 08:46:57.761 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.view.Window$Callback.onSearchRequested, referenced from method android.support.v7.view.WindowCallbackWrapper.onSearchRequested
06-29 08:46:57.761 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve interface method 17515: Landroid/view/Window$Callback;.onSearchRequested (Landroid/view/SearchEvent;)Z
06-29 08:46:57.762 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.view.Window$Callback.onWindowStartingActionMode, referenced from method android.support.v7.view.WindowCallbackWrapper.onWindowStartingActionMode
06-29 08:46:57.762 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve interface method 17519: Landroid/view/Window$Callback;.onWindowStartingActionMode (Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode;
06-29 08:46:57.785 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.widget.TintTypedArray.getChangingConfigurations
06-29 08:46:57.785 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 702: Landroid/content/res/TypedArray;.getChangingConfigurations ()I
06-29 08:46:57.786 23590-23590/com.example.tantine1.housefindpro I/dalvikvm: Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.widget.TintTypedArray.getType
06-29 08:46:57.786 23590-23590/com.example.tantine1.housefindpro W/dalvikvm: VFY: unable to resolve virtual method 724: Landroid/content/res/TypedArray;.getType (I)I
06-29 08:46:57.818 23590-23590/com.example.tantine1.housefindpro I/type: ******************
06-29 08:46:57.818 23590-23590/com.example.tantine1.housefindpro I/ville: Abong-Mbang
06-29 08:46:57.861 23590-23590/com.example.tantine1.housefindpro E/RecyclerView: No adapter attached; skipping layout
06-29 08:46:57.880 23590-24074/com.example.tantine1.housefindpro I/statusI: 200
06-29 08:46:57.881 23590-24074/com.example.tantine1.housefindpro I/arnaud: test
06-29 08:46:57.882 23590-24074/com.example.tantine1.housefindpro W/System.err: org.json.JSONException: Value Villa of type java.lang.String cannot be converted to JSONObject
06-29 08:46:57.886 23590-24074/com.example.tantine1.housefindpro W/System.err:     at org.json.JSON.typeMismatch(JSON.java:111)
06-29 08:46:57.886 23590-24074/com.example.tantine1.housefindpro W/System.err:     at org.json.JSONObject.<init>(JSONObject.java:159)
06-29 08:46:57.887 23590-24074/com.example.tantine1.housefindpro W/System.err:     at org.json.JSONObject.<init>(JSONObject.java:172)
06-29 08:46:57.887 23590-24074/com.example.tantine1.housefindpro W/System.err:     at com.example.tantine1.housefindpro.consulAffiche.parseResult(consulAffiche.java:144)
06-29 08:46:57.887 23590-24074/com.example.tantine1.housefindpro W/System.err:     at com.example.tantine1.housefindpro.consulAffiche.access$000(consulAffiche.java:37)
06-29 08:46:57.887 23590-24074/com.example.tantine1.housefindpro W/System.err:     at com.example.tantine1.housefindpro.consulAffiche$AsyncHttpTask.doInBackground(consulAffiche.java:106)
06-29 08:46:57.887 23590-24074/com.example.tantine1.housefindpro W/System.err:     at com.example.tantine1.housefindpro.consulAffiche$AsyncHttpTask.doInBackground(consulAffiche.java:79)
06-29 08:46:57.887 23590-24074/com.example.tantine1.housefindpro W/System.err:     at android.os.AsyncTask$2.call(AsyncTask.java:288)
06-29 08:46:57.887 23590-24074/com.example.tantine1.housefindpro W/System.err:     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
06-29 08:46:57.887 23590-24074/com.example.tantine1.housefindpro W/System.err:     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
06-29 08:46:57.887 23590-24074/com.example.tantine1.housefindpro W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
06-29 08:46:57.887 23590-24074/com.example.tantine1.housefindpro W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
06-29 08:46:57.888 23590-24074/com.example.tantine1.housefindpro W/System.err:     at java.lang.Thread.run(Thread.java:841)
06-29 08:46:57.888 23590-24074/com.example.tantine1.housefindpro I/arnaud0: Value Villa of type java.lang.String cannot be converted to JSONObject
06-29 08:46:57.901 23590-23590/com.example.tantine1.housefindpro E/RecyclerView: No adapter attached; skipping layout
 
Your code is having problems creating a JSONObject at line

Code:
JSONObject response = new JSONObject(result);

It would be helpful to see what the result parameter passed in to parseResult() is.
So I would set a breakpoint in this method, and look at the value of that variable. Is there anything unusual or malformed about it?
 
infact i am not sure but i am suspecting that the error is coming from the fact that the variable response is of type StringBuilder at line 100 and when sending it to my parseResult method at line 107 i tried to convert it to String. But when i don't convert i have a mismatch error.
 
Well you could try

Code:
parseResult(response.toString());

which is the conventional way of getting a String out of a StringBuilder.

You should still breakpoint at the start of parseResult() and examine what String value you have actually passed in.
 
Back
Top Bottom