Что пошло не так: не удалось выполнить задачу ':app:checkDebugAarMetadata'.
Не удалось разрешить все файлы для конфигурации ':app:debugRuntimeClasspath'.
Не удалось преобразовать UsbSerial-6.1.0.aar (com.github.felHR85:UsbSerial:6.1.0) для соответствия атрибутам {artifactType=android -aar-metadata, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
Не удалось найти UsbSerial-6.1 .0.aar (com.github.felHR85:UsbSerial:6.1.0).
Выполняется поиск в следующих местах:
https://jitpack.io/com/github/felHR85/UsbSerial/6.1. 0/UsbSerial-6.1.0.aar
https://jitpack.io/com/github/felHR85/U ... -6.1.0.jar
Мой файл Gradle:
Код: Выделить всё
buildscript {
ext.kotlin_version = '1.9.0'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
}
}
subprojects {
afterEvaluate { project ->
if (project.plugins.hasPlugin("com.android.application") ||
project.plugins.hasPlugin("com.android.library")) {
project.android {
compileSdkVersion 34
buildToolsVersion "34.0.0"
}
}
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
Код: Выделить всё
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
def flutterTargetSdkVersion = localProperties.getProperty('flutter.targetSdkVersion')
if (flutterTargetSdkVersion == null) {
flutterTargetSdkVersion = '30' // Установите значение по умолчанию, если необходимо
}
android {
namespace "name"
compileSdkVersion 34
ndkVersion flutter.ndkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
applicationId "name"
minSdkVersion 21
targetSdkVersion flutterTargetSdkVersion.toInteger()
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
buildTypes {
release {
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation 'com.yandex.android:maps.mobile:4.6.1-full'
implementation 'com.github.felHR85:UsbSerial:6.1.0'
constraints {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0") {
because("kotlin-stdlib-jdk7 is now a part of kotlin-stdlib")
}
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0") {
because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib")
}
}
}
Код: Выделить всё
implementation 'com.github.felHR85:UsbSerial:6.1.0'
Код: Выделить всё
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
Также пробовал менять версию JDK и саму Android Studio, но ничего не помогло
Мне нужна помощь, пожалуйста
Подробнее здесь: https://stackoverflow.com/questions/791 ... -studio-fl