Could not execute method for android:onClick - retrofit
<p>I'm trying to retrieve data from a web api.
I use retrofit, I made the interface for it, but when I try to use it, I have an exception declare</p>

<pre><code>E/AndroidRuntime: FATAL EXCEPTION: main
              Process: com.wind.wind, PID: 2388
              java.lang.IllegalStateException: Could not execute method for android:onClick
                  at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:293)
                  at android.view.View.performClick(View.java:4438)
                  at android.view.View$PerformClick.run(View.java:18422)
                  at android.os.Handler.handleCallback(Handler.java:733)
                  at android.os.Handler.dispatchMessage(Handler.java:95)
                  at android.os.Looper.loop(Looper.java:136)
                  at android.app.ActivityThread.main(ActivityThread.java:5017)
                  at java.lang.reflect.Method.invokeNative(Native Method)
                  at java.lang.reflect.Method.invoke(Method.java:515)
                  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
                  at dalvik.system.NativeStart.main(Native Method)
               Caused by: java.lang.reflect.InvocationTargetException
                  at java.lang.reflect.Method.invokeNative(Native Method)
                  at java.lang.reflect.Method.invoke(Method.java:515)
                  at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:288)
                  at android.view.View.performClick(View.java:4438) 
                  at android.view.View$PerformClick.run(View.java:18422) 
                  at android.os.Handler.handleCallback(Handler.java:733) 
                  at android.os.Handler.dispatchMessage(Handler.java:95) 
                  at android.os.Looper.loop(Looper.java:136) 
                  at android.app.ActivityThread.main(ActivityThread.java:5017) 
                  at java.lang.reflect.Method.invokeNative(Native Method) 
                  at java.lang.reflect.Method.invoke(Method.java:515) 
                  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 
                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 
                  at dalvik.system.NativeStart.main(Native Method) 
               Caused by: java.lang.NullPointerException
                  at com.wind.wind.sign_in.onClicksignin(sign_in.java:57)
                  at java.lang.reflect.Method.invokeNative(Native Method) 
                  at java.lang.reflect.Method.invoke(Method.java:515) 
                  at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:288) 
                  at android.view.View.performClick(View.java:4438) 
                  at android.view.View$PerformClick.run(View.java:18422) 
                  at android.os.Handler.handleCallback(Handler.java:733) 
                  at android.os.Handler.dispatchMessage(Handler.java:95) 
                  at android.os.Looper.loop(Looper.java:136) 
                  at android.app.ActivityThread.main(ActivityThread.java:5017) 
                  at java.lang.reflect.Method.invokeNative(Native Method) 
                  at java.lang.reflect.Method.invoke(Method.java:515) 
                  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 
                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 
                  at dalvik.system.NativeStart.main(Native Method) 
</code></pre>

<p>My code:</p>

<pre><code>package com.wind.wind;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import com.wind.wind.data_user.User;
import com.wind.wind.remote.windAPI;

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

public class sign_in extends AppCompatActivity {

//EditText fields
EditText login_;
EditText password_;

//String containers
private String login;
private String password;
private windchatAPI api;

@Override
protected void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_sign_in);
    login_ = (EditText) findViewById(R.id.editText);
    password_ = (EditText) findViewById(R.id.editText2);
}

public void onClicksignin(View v)
{
    login = login_.getText().toString();
    password = password_.getText().toString();
    windchatAPI.Factory.getInstance().getUser().enqueue(new Callback&lt;User&gt;() {
        @Override
        public void onResponse(Call&lt;User&gt; call, Response&lt;User&gt; response)
        {
            Log.e("login success", response.body().getToken());
        }

        @Override
        public void onFailure(Call&lt;User&gt; call, Throwable t) {
            Log.e("login failed", t.getMessage());
        }
    });
}
</code></pre>

<p>I think the problem is that windchatAPI is not declare, but I don't know how to do it.
Can someone help me ?</p>

<p>windAPI is my interface for hold informations:</p>

<pre><code>public interface windAPI
{
  @GET("user/register")
  Call&lt;User&gt; getUser();
  String URL = "my_url";

  class Factory
  {
    private static windAPI service;
    public static windAPI getInstance()
    {
        if (service == NULL)
        {
            //creating the base URL from winchat api
            Retrofit retrofit = new Retrofit.Builder().addConverterFactory(GsonConverterFactory.create()).baseUrl(URL).build();
            service = retrofit.create(windAPI.class);
            return service;
        }
        else
            return service;
    }
  }
}
</code></pre>

<p>XML file:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_sign_in"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.wind.wind.sign_in"
android:background="#fffc00"&gt;

&lt;TextView
    android:text="Login"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_alignParentStart="true"
    android:layout_marginStart="15dp"
    android:layout_marginTop="36dp"
    android:id="@+id/textView"
    android:textSize="18sp" /&gt;

&lt;EditText
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:inputType="textPersonName"
    android:ems="10"
    android:layout_below="@+id/textView"
    android:layout_alignStart="@+id/textView"
    android:layout_marginTop="19dp"
    android:id="@+id/editText"
    android:hint="Enter your login"
    style="@style/Widget.AppCompat.EditText" /&gt;

&lt;EditText
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:inputType="textPassword"
    android:ems="10"
    android:layout_marginTop="19dp"
    android:id="@+id/editText2"
    android:layout_below="@+id/textView2"
    android:layout_alignStart="@+id/textView2"
    style="@style/Widget.AppCompat.EditText"
    android:hint="Enter your password" /&gt;

&lt;TextView
    android:text="Password"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginTop="22dp"
    android:id="@+id/textView2"
    android:layout_below="@+id/editText"
    android:layout_alignStart="@+id/editText"
    android:textSize="18sp" /&gt;

&lt;Button
    android:text="Log in"
    android:layout_height="wrap_content"
    android:layout_marginTop="100dp"
    android:id="@+id/button4"
    android:background="@android:color/holo_blue_dark"
    android:layout_below="@+id/editText2"
    android:layout_centerHorizontal="true"
    android:layout_width="200dp"
    android:textColor="@android:color/background_light"
    android:onClick="onClicksignin" /&gt;
</code></pre>

<p></p>

<p>When I delete in the java code the line windAPI.Factory... it works...</p>

<p>EDIT: manifest added</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.wind.wind"&gt;

&lt;uses-permission android:name="android.permission.CAMERA" /&gt;

&lt;uses-feature android:name="android.hardware.camera" /&gt;

&lt;!-- To auto-complete the email text field in the login form with the user's emails --&gt;
&lt;uses-permission android:name="android.permission.GET_ACCOUNTS" /&gt;
&lt;uses-permission android:name="android.permission.READ_PROFILE" /&gt;
&lt;uses-permission android:name="android.permission.READ_CONTACTS" /&gt;

&lt;!-- Used for retrofit api --&gt;
&lt;uses-permission android:name="android.permission.INTERNET" /&gt;

&lt;application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme"&gt;
    &lt;activity android:name=".Login_page"&gt;
        &lt;intent-filter&gt;
            &lt;action android:name="android.intent.action.MAIN" /&gt;

            &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
        &lt;/intent-filter&gt;
    &lt;/activity&gt;
    &lt;activity android:name=".wind_sent" /&gt;
    &lt;activity android:name=".MainActivity" /&gt;
    &lt;activity android:name=".sign_in" /&gt;
    &lt;activity android:name=".register_activity"&gt;&lt;/activity&gt;
&lt;/application&gt;
</code></pre>

<p></p>