0

I am working on a tablet android app but it crashes while sending sms using smsManager. I have added permissions in manifest and tablet have telephony service too. see my log cat error

java.lang.SecurityException: null from uid 10412 not allowed to perform SEND_SMS 08-26 15:33:36.370 24856-24856/test.in.smarttab E/AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1472) 08-26 15:33:36.370 24856-24856/test.in.smarttab E/AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1426) 08-26 15:33:36.370 24856-24856/test.in.smarttab E/AndroidRuntime: at com.android.internal.telephony.ISms$Stub$Proxy.sendText(ISms.java:485)

This is my manifest code

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="Package_name">

    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

    <!--
         The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
         Google Maps Android API v2, but you must specify either coarse or fine
         location permissions for the 'MyLocation' functionality. 
    -->
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="com.truiton.mapfragment.permission.MAPS_RECEIVE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="com.android.alarm.permission.SET_ALARM"/>
    <uses-permission android:name="android.permission.SEND_SMS"/>

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:largeHeap="true"
        android:supportsRtl="true"
        android:theme="@style/Theme.AppCompat.Light.NoActionBar.FullScreen">
        <receiver
            android:name=".BootUpReceiver"
            android:enabled="true"
            android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </receiver>
        <receiver android:name=".AlarmReceiver"/>
        <service android:name=".Service.AlarmService"/>
        <service android:name=".location.LocationService" />
        <activity
            android:name=".welcomeScreen.WelcomeActivity"
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <!--
             The API key for Google Maps-based APIs is defined as a string resource.
             (See the file "res/values/google_maps_api.xml").
             Note that the API key is linked to the encryption key used to sign the APK.
             You need a different API key for each encryption key, including the release key that is used to
             sign the APK for publishing.
             You can define the keys for the debug and release targets in src/debug/ and src/release/. 
        -->
        <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="@string/google_maps_key" />

    </application>

</manifest>
Pradeep Deshmukh
  • 754
  • 1
  • 8
  • 17

1 Answers1

0

Add Permission for sending sms in manifest file

<uses-permission android:name="android.permission.SEND_SMS" />
Vivek Mishra
  • 5,669
  • 9
  • 46
  • 84