title: Expected BEGIN_ARRAY but was STRING at line 1 column 1 path $ android retrofit gson
body: <p>I am developing with retrofit, but I have a problem. I want to get the results from my server.</p>
  
  <p>This is my result json from my script php:</p>
  
  <pre><code>[{"rubrique_id":"1","rubrique_lib":"syst\u00e8me "},
   {"rubrique_id":"2","rubrique_lib":"s\u00e9curit\u00e9"},
   {"rubrique_id":"3","rubrique_lib":"information"}]
  </code></pre>
  
  <p>This is my model class in java:</p>
  
  <pre><code>public class Bureau {
  
      @SerializedName("rubrique_id")
      private String rubrique_id;
  
      @SerializedName("rubrique_lib")
      private String rubrique_lib;
  
      public String getRubrique_id() {
          return rubrique_id;
      }
  
      public void setRubrique_id(String rubrique_id) {
          this.rubrique_id = rubrique_id;
      }
  
      public String getRubrique_lib() {
          return rubrique_lib;
      }
  
      public void setRubrique_lib(String rubrique_lib) {
          this.rubrique_lib = rubrique_lib;
      }
  
  
  }
  </code></pre>
  
  <p>This is my API class:</p>
  
  <pre><code>public interface BureauApi {
  
      @GET("/")
      Call&lt;List&lt;Bureau&gt;&gt; getBureau();
  }
  </code></pre>
  
  <p>This is main class where I implemented the retrofit library:</p>
  
  <pre><code>public class ParametreActivity extends AppCompatActivity {
      private Spinner spinner = null;
      private static final String BASE_URL = "http://192.168.56.1:80/posteboosterAPI/methodes.php/";
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_parametre);
          spinner = (Spinner)findViewById(R.id.list_bureau);
          final List&lt;String&gt; listBureau = new ArrayList&lt;String&gt;();
          listBureau.add("bureau1");
          listBureau.add("bureau2");
  
          Gson gson = new GsonBuilder()
                  .setLenient()
                  .create();
  
          Retrofit retrofit = new Retrofit.Builder()
                               .baseUrl(BASE_URL)
                               .addConverterFactory(GsonConverterFactory.create(gson))
                               .build();
          BureauApi  service = retrofit.create(BureauApi.class);
  
          Call&lt;List&lt;Bureau&gt;&gt; call = service.getBureau();
           call.enqueue(new Callback&lt;List&lt;Bureau&gt;&gt;() {
               @Override
               public void onResponse(Call&lt;List&lt;Bureau&gt;&gt; call, Response&lt;List&lt;Bureau&gt;&gt; response) {
  
                   if (response.isSuccessful()) {
  
                       for (Bureau bureaus :response.body()
                               ) {
                           Log.i("log", bureaus.getRubrique_lib());
                       }
                   }else {
  
                       Log.i("log", "l'objet est vide "+response.message());
                   }
               }
  
               @Override
               public void onFailure(Call&lt;List&lt;Bureau&gt;&gt; call, Throwable t) {
                   Log.i("log","erreur survenu dans la requete "+ t.getMessage());
  
               }
           });
          ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_spinner_item,listBureau);
          adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
          spinner.setAdapter(adapter);
      }
  }
  </code></pre>
  
  <p>And the console is giving me the following error:</p>
  
  <blockquote>
    <p>Expected BEGIN_ARRAY but was STRING at line 1 column 1 path $</p>
  </blockquote>