My app was working perfectly previously but now when i generate a new build it builds but crashes on launch with the error below. I have not made any changes to the code since last time and have several backuos which i tried and all gave the same issue. The issue appears to be with the ironsource_mediation plugin and a new version was released recently which may have caused a bug?
Regardsless i have forced it to use the old version of the plugin but get the same error. The app works fine on ios but the issue seems to be on android.
java.lang.NoSuchMethodError: No static method validateIntegration(Landroid/app/Activity;)V in class Lcom/ironsource/mediationsdk/integration/IntegrationHelper; or its super classes (declaration of 'com.ironsource.mediationsdk.integration.IntegrationHelper' appears in /data/app/~~WHA-ga3igS5f1uG-UlE9Yw==/com.Company.App-Nvebbp1CFFvx7Z8gspxb4A==/base.apk!classes18.dex)
Here is my code for the integration
Future<void> initIronSource() async {
var IronSourceIdAndroid = myStrings['IronSourceIdAndroid'];
var IronSourceIdIos = myStrings['IronSourceIdIos'];
if (defaultTargetPlatform == TargetPlatform.iOS ||
defaultTargetPlatform == TargetPlatform.android) {
final appKey = Platform.isAndroid
? IronSourceIdAndroid
: Platform.isIOS
? IronSourceIdIos
: throw Exception("Unsupported Platform");
try {
IronSource.setFlutterVersion('2.8.1');
IronSource.setImpressionDataListener(this);
await enableDebug();
await IronSource.shouldTrackNetworkState(true);
await setRegulationParams();
String id = await IronSource.getAdvertiserId();
await IronSource.setUserId(_APP_USER_ID);
if (Platform.isIOS) {
await checkATT();
}
await IronSource.init(
appKey: appKey!,
adUnits: [
IronSourceAdUnit.RewardedVideo,
IronSourceAdUnit.Interstitial,
IronSourceAdUnit.Banner,
IronSourceAdUnit.Offerwall
],
initListener: this);
} on PlatformException catch (e) {
print(e);
}
} else {}
}
As said before the app was perfect last time i checked about a month ago which is why i beleive its a dependency issue. I have run flutter clean and cleared the cache several times and rebuilt the app etc with no result. Its almost as if it doesnt acceot the .kt code from the ironsource_mediation package and says there is no such method. Upon removing the validate integration method from the code the same error shows for the init method.