#flutter #gradle #build #build.gradle
Вопрос:
Ошибка:
FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:mergeDebugNativeLibs'. gt; Could not resolve all files for configuration ':app:debugRuntimeClasspath'. gt; Failed to transform window-java-1.0.0-beta04.aar (androidx.window:window-java:1.0.0-beta04) to match attributes {artifactType=android-java-res, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}. gt; Execution failed for AarTransform: C:Userspatil.gradlecachestransforms-2files-2.17d8400aa5211d2fa7376d36c4ae0a810jetified-window-java-1.0.0-beta04. gt; Cannot parse result path string: gt; Failed to transform window-1.0.0-beta04.aar (androidx.window:window:1.0.0-beta04) to match attributes {artifactType=android-java-res, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}. gt; Execution failed for AarTransform: C:Userspatil.gradlecachestransforms-2files-2.19c43fd3a6ad978cd34a93a3c68eacaebjetified-window-1.0.0-beta04. gt; Cannot parse result path string: gt; Failed to transform core-ktx-1.6.0.aar (androidx.core:core-ktx:1.6.0) to match attributes {artifactType=android-java-res, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}. gt; Execution failed for AarTransform: C:Userspatil.gradlecachestransforms-2files-2.14aa7d3b1199075332be38a770883fe79jetified-core-ktx-1.6.0. gt; Cannot parse result path string: gt; Failed to transform fragment-1.1.0.aar (androidx.fragment:fragment:1.1.0) to match attributes {artifactType=android-java-res, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}. gt; Execution failed for AarTransform: C:Userspatil.gradlecachestransforms-2files-2.1c9cdaf4182134f09911a36f189490385fragment-1.1.0. gt; Cannot parse result path string: gt; Failed to transform viewpager-1.0.0.aar (androidx.viewpager:viewpager:1.0.0) to match attributes {artifactType=android-java-res, org.gradle.status=release}. gt; Execution failed for AarTransform: C:Userspatil.gradlecachestransforms-2files-2.18911a3ecd6aa12e0e84bb43db8e5d4d9viewpager-1.0.0. gt; Cannot parse result path string: gt; Failed to transform viewpager-1.0.0.aar (androidx.viewpager:viewpager:1.0.0) to match attributes {artifactType=android-java-res, org.gradle.status=release}. gt; Execution failed for AarTransform: C:Userspatil.gradlecachestransforms-2files-2.18911a3ecd6aa12e0e84bb43db8e5d4d9viewpager-1.0.0. gt; Cannot parse result path string: gt; Failed to transform loader-1.0.0.aar (androidx.loader:loader:1.0.0) to match attributes {artifactType=android-java-res, org.gradle.status=release}. gt; Execution failed for AarTransform: C:Userspatil.gradlecachestransforms-2files-2.1c51007774f4fd6d14ba4adbca0679a8aloader-1.0.0. gt; Cannot parse result path string: gt; Failed to transform activity-1.0.0.aar (androidx.activity:activity:1.0.0) to match attributes {artifactType=android-java-res, org.gradle.status=release}. gt; Execution failed for AarTransform: C:Userspatil.gradlecachestransforms-2files-2.18add393c18bb8b0f40364f4f0122baedjetified-activity-1.0.0. gt; Cannot parse result path string: gt; Failed to transform customview-1.0.0.aar (androidx.customview:customview:1.0.0) to match attributes {artifactType=android-java-res, org.gradle.status=release}. gt; Execution failed for AarTransform: C:Userspatil.gradlecachestransforms-2files-2.1f8347eebbb40a7a16c766592439b20a2customview-1.0.0. gt; Cannot parse result path string: gt; Failed to transform core-1.6.0.aar (androidx.core:core:1.6.0) to match attributes {artifactType=android-java-res, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}. gt; Execution failed for AarTransform: C:Userspatil.gradlecachestransforms-2files-2.144318f973e18fa59fe3957d8af199b21core-1.6.0. gt; Cannot parse result path string:
///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
Я попытался изменить версию SDK, но это не работает для меня. Я не могу запустить свое приложение на эмуляторе или мобильном телефоне из-за этой ошибки. Я надеюсь, что смогу избавиться от этой проблемы, которая возникает в моей системе Вот my android/app/build.Gradle file:
def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { localPropertiesFile.withReader('UTF-8') { reader -gt; localProperties.load(reader) } } def flutterRoot = localProperties.getProperty('flutter.sdk') if (flutterRoot == null) { throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") } def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' } def flutterVersionName = localProperties.getProperty('flutter.versionName') if (flutterVersionName == null) { flutterVersionName = '1.0' } apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { compileSdkVersion flutter.compileSdkVersion buildToolsVersion '26.0.1' compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = '1.8' } sourceSets { main.java.srcDirs = 'src/main/kotlin' } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.radioai" minSdkVersion flutter.minSdkVersion targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName multiDexEnabled true } buildTypes { release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. signingConfig signingConfigs.debug } } } flutter { source '../..' } dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" }