Open devalp-pro opened 1 year ago
i have the same error
Yes, I found same error, Please use 'device_info_plus' dependency and remove ' platform_device_id: ^1.0.1'
Use device_info_plus plugin developed by the Flutter community.
This is how you can get IDs on both platforms.
In your pubspec.yaml file add this: dependencies: device_info_plus: ^3.2.3
Create a method:
Future<String?> _getId() async { var deviceInfo = DeviceInfoPlugin(); if (Platform.isIOS) { // import 'dart:io' var iosDeviceInfo = await deviceInfo.iosInfo; return iosDeviceInfo.identifierForVendor; // unique ID on iOS } else if(Platform.isAndroid) { var androidDeviceInfo = await deviceInfo.androidInfo; return androidDeviceInfo.androidId; // unique ID on Android } }
use this gradle version is ok dependencies { classpath 'com.android.tools.build:gradle:7.1.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" }
use this gradle version is ok dependencies { classpath 'com.android.tools.build:gradle:7.1.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" }
thank you . it works for me .
Android Gradle Error due to the latest version used in the project. Package contains lower grade and kotlin version that is not supported to build with latest Gradle version.