Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $
<p>What is this error ? How can I fix this? My app is running but can't load data. And this is my Error: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $</p>
<p>This is my fragment :</p>
<pre><code>public class news extends Fragment {


private RecyclerView recyclerView;
private ArrayList&lt;Deatails&gt; data;
private DataAdapter adapter;
private View myFragmentView;



@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    myFragmentView = inflater.inflate(R.layout.news, container, false);
    initViews();
    return myFragmentView;

}


private void initViews() {
    recyclerView = (RecyclerView) myFragmentView.findViewById(R.id.card_recycler_view);
    RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getActivity().getApplicationContext());
    recyclerView.setHasFixedSize(true);
    recyclerView.setLayoutManager(layoutManager);
    data = new ArrayList&lt;Deatails&gt;();
    adapter = new DataAdapter(getActivity(), data);
    recyclerView.setAdapter(adapter);

    new Thread()
    {
        public void run()
        {
            getActivity().runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    loadJSON();
                }
            });

        }
    }
    .start();
}

private void loadJSON() {
    if (isNetworkConnected()){

        HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
        interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
        OkHttpClient client = new OkHttpClient.Builder()
                .addInterceptor(interceptor)
                .retryOnConnectionFailure(true)
                .connectTimeout(15, TimeUnit.SECONDS)
                .build();

        Gson gson = new GsonBuilder()
                .setLenient()
                .create();
        
        Retrofit retrofit = new Retrofit.Builder()
                .baseUrl(&quot;http://www.memaraneha.ir/&quot;)
                .client(client)
                .addConverterFactory(GsonConverterFactory.create(gson))
                .build();
        
        RequestInterface request = retrofit.create(RequestInterface.class);
        Call&lt;JSONResponse&gt; call = request.getJSON();
        final ProgressDialog progressDialog = new ProgressDialog(getActivity());
        progressDialog.show();
        call.enqueue(new Callback&lt;JSONResponse&gt;() {
            @Override
            public void onResponse(Call&lt;JSONResponse&gt; call, Response&lt;JSONResponse&gt; response) {
                progressDialog.dismiss();
                JSONResponse jsonResponse = response.body();
                data.addAll(Arrays.asList(jsonResponse.getAndroid()));
                adapter.notifyDataSetChanged();
            }
            @Override
            public void onFailure(Call&lt;JSONResponse&gt; call, Throwable t) {
                progressDialog.dismiss();
                Log.d(&quot;Error&quot;, t.getMessage());
            }
        });
    }
    else {
        Toast.makeText(getActivity().getApplicationContext(), &quot;Internet is disconnected&quot;, Toast.LENGTH_LONG).show();}
}
private boolean isNetworkConnected() {
    ConnectivityManager cm = (ConnectivityManager) getActivity().getSystemService(Context.CONNECTIVITY_SERVICE);
    NetworkInfo ni = cm.getActiveNetworkInfo();
    if (ni == null) {
        // There are no active networks.
        return false;
    } else
        return true;
}
}
</code></pre>
<p>RequestInterface :</p>
<pre><code>public interface RequestInterface {

@GET(&quot;Erfan/news.php&quot;)
Call&lt;JSONResponse&gt; getJSON();
}
</code></pre>
<p><a href="https://i.stack.imgur.com/QQaa8.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/QQaa8.jpg" alt="a" /></a></p>
<h2>UPDATE  (read below text and find your problem)</h2>
<ul>
<li>most of the time, this error isn't about your json but it could be a
incorrect http request such as a missing or a incorrect header, first check your request with postman to verify the servers response and servers response headers. if nothing is wrong then the error mostly came from your programmed http request, also it could because the servers response is not json (in some cases response could be html).</li>
</ul>