I'm trying to send SMS from android application to sim number. sms manager giving me this error.
Error:Execution failed for task ':app:transformClassesWithInstantRunForDebug'. android/telephony/SmsManager : Unsupported major.minor version 52.0
here is my code
private class MyCLiCkListner implements View.OnClickListener {
@Override
public void onClick(View view) {
String number = "03470000000";
String sms = "hi Mehdi";
try {
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(number, null, sms, null, null);
Toast.makeText(getApplicationContext(), "SMS Sent!",
Toast.LENGTH_LONG).show();
} catch (Exception e) {
Toast.makeText(getApplicationContext(),
"SMS faild, please try again later!",
Toast.LENGTH_LONG).show();
e.printStackTrace();
}
}
}
this is my gradle
android {
compileSdkVersion 24
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "balti.sendsmsonnumber"
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.1.1'``
}