Die Abhängigkeit „:flutter_local_notifications“ erfordert, dass die Entzuckerung der Kernbibliothek für :app aktiviert iAndroid

Forum für diejenigen, die für Android programmieren
Guest
 Die Abhängigkeit „:flutter_local_notifications“ erfordert, dass die Entzuckerung der Kernbibliothek für :app aktiviert i

Post by Guest »

Ich versuche, diese vorgefertigte App auszuführen, aber sie hat nicht funktioniert, also musste ich das AGP aktualisieren. Danach erhalte ich immer wieder diesen Fehler. Ich bin ein Neuling im Umgang mit Dart und Android, also...
Bitte lassen Sie mich wissen, wenn Sie weitere Informationen benötigen. Ich habe die von mir verwendeten Versionen angegeben.

Code: Select all

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
> An issue was found when checking AAR metadata:

1.  Dependency ':flutter_local_notifications' requires core library desugaring to be enabled
for :app.

See https://developer.android.com/studio/write/java8-support.html for more
details.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 2s
flutter doctor -v

Code: Select all

[√] Flutter (Channel stable, 3.10.0, on Microsoft Windows [Version 10.0.22631.4317], locale en-US)
• Flutter version 3.10.0 on channel stable at C:\flutter\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 84a1e904f4 (1 year, 6 months ago), 2023-05-09 07:41:44 -0700
• Engine revision d44b5a94c9
• Dart version 3.0.0
• DevTools version 2.23.1

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at C:\Users\A\AppData\Local\Android\sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 21.0.3+-12282718-b509.11)
• All Android licenses accepted.

[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[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 2024.2)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 21.0.3+-12282718-b509.11)

[√] VS Code (version 1.95.1)
• VS Code at C:\Users\A\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.100.0

[√] Connected device (4 available)
• sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64    • Android 14 (API 34) (emulator)
• Windows (desktop)            • windows       • windows-x64    • Microsoft Windows [Version 10.0.22631.4317]
• Chrome (web)                 • chrome        • web-javascript • Google Chrome 122.0.6261.112
• Edge (web)                   • edge          • web-javascript • Microsoft Edge 130.0.2849.68

[√] Network resources
• All expected network resources are available.

! Doctor found issues in 1 category.
app\bulid.gradle

Code: Select all

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
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 {
namespace "code_level_1"
compileSdkVersion 34
ndkVersion "25.1.8937393"

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.dbestech.shop_app_code_level_1"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 25
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}

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

android\bulid.gradle

Code: Select all

buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:8.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
mavenCentral()
}
}

rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}

tasks.register("clean", Delete) {
delete rootProject.buildDir
}

Ich habe einige Lösungen wie diese ausprobiert, aber nichts hat funktioniert.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post