platform_device_id icon indicating copy to clipboard operation
platform_device_id copied to clipboard

Android Build Error

Open devalp-pro opened this issue 2 years ago • 4 comments

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.


* 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 ':platform_device_id' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.3.8, on Microsoft Windows [Version 10.0.22621.819], locale en-IN)
Checking Android licenses is taking an unexpectedly long time...[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[√] Chrome - develop for the web
[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2021.3)
[√] VS Code (version 1.73.1)
[√] Connected device (4 available)
[√] HTTP Host Availability

! Doctor found issues in 1 category.

devalp-pro avatar Nov 21 '22 05:11 devalp-pro

i have the same error

YaizukStrange avatar Jan 17 '23 14:01 YaizukStrange

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 } }

shraddha-7span avatar Jan 24 '23 11:01 shraddha-7span

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" }

cwangfr avatar Jun 26 '23 13:06 cwangfr

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 .

008v avatar Feb 08 '24 07:02 008v