title: Android android.permission.SEND_SMS not working
body: <p>I'm trying to send a SMS from my emulator to the second emulator </p>
  
  <p>The main problem is that Android android.permission.SEND_SMS is not working probably.</p>
  
  <p>I'm not sure is the problem because I have the latest SDK installed or what ?</p>
  
  <p>I get the following expectation error that I don't have android.permission.SEND_SMS.</p>
  
  <pre><code>12-02 21:46:04.150 7881-7881/? W/System: ClassLoader referenced unknown path: /data/app/com.example.alakeel.sms-2/lib/x86_64
  12-02 21:46:04.240 7881-7881/com.example.alakeel.sms D/---: Fail
  12-02 21:46:04.240 7881-7881/com.example.alakeel.sms W/System.err: java.lang.SecurityException: Sending SMS message: uid 10057 does not have android.permission.SEND_SMS.
  12-02 21:46:04.240 7881-7881/com.example.alakeel.sms W/System.err:     at android.os.Parcel.readException(Parcel.java:1599)
  12-02 21:46:04.240 7881-7881/com.example.alakeel.sms W/System.err:     at android.os.Parcel.readException(Parcel.java:1552)
  12-02 21:46:04.240 7881-7881/com.example.alakeel.sms W/System.err:     at com.android.internal.telephony.ISms$Stub$Proxy.sendTextForSubscriber(ISms.java:768)
  12-02 21:46:04.240 7881-7881/com.example.alakeel.sms W/System.err:     at android.telephony.SmsManager.sendTextMessageInternal(SmsManager.java:310)
  12-02 21:46:04.240 7881-7881/com.example.alakeel.sms W/System.err:     at android.telephony.SmsManager.sendTextMessage(SmsManager.java:293)
  12-02 21:46:04.240 7881-7881/com.example.alakeel.sms W/System.err:     at com.example.alakeel.sms.MainActivity.onCreate(MainActivity.java:19)
  12-02 21:46:04.240 7881-7881/com.example.alakeel.sms W/System.err:     at android.app.Activity.performCreate(Activity.java:6237)
  12-02 21:46:04.240 7881-7881/com.example.alakeel.sms W/System.err:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
  12-02 21:46:04.240 7881-7881/com.example.alakeel.sms W/System.err:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
  12-02 21:46:04.240 7881-7881/com.example.alakeel.sms W/System.err:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
  12-02 21:46:04.240 7881-7881/com.example.alakeel.sms W/System.err:     at android.app.ActivityThread.-wrap11(ActivityThread.java)
  12-02 21:46:04.240 7881-7881/com.example.alakeel.sms W/System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
  12-02 21:46:04.240 7881-7881/com.example.alakeel.sms W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:102)
  12-02 21:46:04.240 7881-7881/com.example.alakeel.sms W/System.err:     at android.os.Looper.loop(Looper.java:148)
  12-02 21:46:04.240 7881-7881/com.example.alakeel.sms W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:5417)
  12-02 21:46:04.240 7881-7881/com.example.alakeel.sms W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
  12-02 21:46:04.240 7881-7881/com.example.alakeel.sms W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
  12-02 21:46:04.240 7881-7881/com.example.alakeel.sms W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
  </code></pre>
  
  <p>Code for Manifest:</p>
  
  <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.alakeel.sms"&gt;
  
      &lt;uses-permission android:name="android.permission.SEND_SMS"/&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=".MainActivity"&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;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>Code for MainActivity class:</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
  
          try {
              SmsManager smsManager = SmsManager.getDefault();
              smsManager.sendTextMessage("+5554", null, "Bus will be at your door in 30 seconds", null, null);
              Toast.makeText(getApplicationContext(), "SMS Sent!", Toast.LENGTH_LONG).show();
              Log.d("---", "Sent");
  
          }
  
          catch (Exception e) {
              Toast.makeText(getApplicationContext(), "SMS faild, please try again.", Toast.LENGTH_LONG).show();
              Log.d("---","Fail");
              e.printStackTrace();
          }
  
      }
  }
  </code></pre>