I got this error while trying to run this code.
import 'package:flutter_sms/flutter_sms.dart';
import "dart:async";
String message = "This is a test message!";
List<String> recipents = ["6874171269", "5556787676"];
void _sendSMS(String message, List<String> recipents) async {
String result = await sendSMS(message: message, recipients: recipents)
.catchError((onError) {
print(onError);
});
print(result);
}
void main() {
_sendSMS(message, recipents);
}
What went wrong: The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher. The following dependencies do not satisfy the required version: project ':flutter_sms' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50
So i went to the build.gradle file.
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
My Kotlin version is aldready higher than 1.5.20. Still getting this error. How do i resolve this issue ?
The version in android/build_gradle of the flutter_sms package must be modified.