Schritte:
- Überprüfte meine Java-Version: Mein System hatte eine Java-Version 21.0.5, diese ist jedoch nicht für die Verwendung konfiguriert, da die Umgebungsvariable JAVA_HOME nicht festgelegt ist. Daher wird das mit Android Studio gelieferte Standard-Java verwendet, das Version 21.0.4 ist, wie in der Ausgabe von flutter doctor --verbose angegeben.
Überprüfte die Kompatibilitätsmatrix und verwendete im folgenden Konfigurationsprozess die beiden Gradle-Versionen 8.4 und 8.5 parallel zur Java-Version 21.< /p> - Öffnete ein Terminal, ging zum Verzeichnis
/android/ und führte die folgenden Befehle aus:Code: Select all
./gradlew wrapper --gradle-version=8.4
Code: Select all
Welcome to Gradle 7.6.3!
Here are the highlights of this release:
- Added support for Java 19.
- Introduced `--rerun` flag for individual task rerun.
- Improved dependency block for test suites to be strongly typed.
- Added a pluggable system for Java toolchains provisioning.
For more details see https://docs.gradle.org/7.6.3/release-notes.html
Starting a Gradle Daemon, 2 incompatible and 1 stopped Daemons could not be reused, use --status for details
> Task :gradle:compileGroovy FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':gradle:compileGroovy'.
> BUG! exception in phase 'semantic analysis' in source unit '/home/ajthapa/dev/tooling/flutter/packages/flutter_tools/gradle/src/main/groovy/app_plugin_loader.groovy' Unsupported class file major version 65
* 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 14s
1 actionable task: 1 executed
- Dann habe ich eine erstellt Sicherung von
/android/gradle/wrapper/gradle-wrapper.properties in diesem Verzeichnis und Änderung des Inhalts der Originaldatei von:
Code: Select all
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
Code: Select all
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip
Code: Select all
Launching lib/main.dart on sdk gphone64 x86 64 in debug mode...
Warning: This version only understands SDK XML versions up to 3 but an SDK XML file of version 4 was encountered. This can happen if you use versions of Android Studio and the command-line tools that were released at different times.
Checking the license for package Android SDK Build-Tools 30.0.3 in /home/ajthapa/Android/Sdk/licenses
License for package Android SDK Build-Tools 30.0.3 accepted.
Preparing "Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)".
"Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)" ready.
Installing Android SDK Build-Tools 30.0.3 in /home/ajthapa/Android/Sdk/build-tools/30.0.3
"Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)" complete.
"Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)" finished.
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
Code: Select all
3 warnings
ERROR:/home/ajthapa/dev/projects/flutter/NepaliUnitConv/00__Play_Store_builds/00__Closed_Test_version/update__feature_tests/NepaliUnitConv_v1.0.29__without_Admob_Ads/nepali_unit_conv/build/path_provider_android/intermediates/runtime_library_classes_jar/debug/classes.jar: D8: java.lang.NullPointerException: Cannot invoke "String.length()" because "
" is null
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeLibDexDebug'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Failed to transform classes.jar (project :path_provider_android) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, com.android.build.api.attributes.AgpVersionAttr=7.3.0, com.android.build.api.attributes.BuildTypeAttr=debug, com.android.build.gradle.internal.attributes.VariantAttr=debug, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=21, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
> Execution failed for DexingWithClasspathTransform: /home/ajthapa/dev/projects/flutter/NepaliUnitConv/00__Play_Store_builds/00__Closed_Test_version/update__feature_tests/NepaliUnitConv_v1.0.29__without_Admob_Ads/nepali_unit_conv/build/path_provider_android/intermediates/runtime_library_classes_jar/debug/classes.jar.
> Error while dexing.
* 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 4m 10s
Error: Gradle task assembleDebug failed with exit code 1
Exited (1).
Wie Kann ich das beheben?
Update 01: Ausgabe von flutter doctor --verbose :
Code: Select all
[✓] Flutter (Channel stable, 3.27.2, on Ubuntu 24.04.1 LTS 6.8.0-51-generic, locale en_GB.UTF-8)
• Flutter version 3.27.2 on channel stable at /home/ajthapa/dev/tooling/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 68415ad1d9 (4 days ago), 2025-01-13 10:22:03 -0800
• Engine revision e672b006cb
• Dart version 3.6.1
• DevTools version 2.40.2
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.1)
• Android SDK at /home/ajthapa/Android/Sdk
• Platform android-35, build-tools 35.0.1
• Java binary at: /home/ajthapa/dev/tooling/android-studio/jbr/bin/java
• Java version OpenJDK Runtime Environment (build 21.0.4+-12422083-b607.1)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at google-chrome
[✓] Linux toolchain - develop for Linux desktop
• Ubuntu clang version 18.1.3 (1ubuntu1)
• cmake version 3.28.3
• ninja version 1.11.1
• pkg-config version 1.8.1
[✓] Android Studio (version 2024.2)
• Android Studio at /home/ajthapa/dev/tooling/android-studio
• Flutter plugin version 83.0.3
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 21.0.4+-12422083-b607.1)
[✓] VS Code (version 1.96.4)
• VS Code at /usr/share/code
• Flutter extension version 3.102.0
[✓] Connected device (3 available)
• sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 15 (API 35) (emulator)
• Linux (desktop) • linux • linux-x64 • Ubuntu 24.04.1 LTS 6.8.0-51-generic
• Chrome (web) • chrome • web-javascript • Google Chrome 131.0.6778.204
[✓] Network resources
• All expected network resources are available.
• No issues found!