Reputation: 712
I want to build my Flutter app in debug mode for the Android emulator, but I'm encountering an error. (I have included the error message below.) However, I have no issues building it in debug mode for the iOS emulator.
How can I resolve this problem?
Here is the error message.
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all dependencies for configuration ':app:debugCompileClasspath'.
> Could not create task ':app:generateDebugLintModel'.
> java.lang.NullPointerException (no error message)
I will provide the error message below, which occurred when executing 'flutter run --verbose' command. (Since it is a long text, I will only include the top part.)
'/Users/user/.pub-cache/hosted/pub.dev/webview_flutter_android-3.7.1/android/build.gradle'.
[ ] All projects evaluated.
[ ] Task name matched 'assembleDebug'
[ ] Selected primary task 'assembleDebug' from project :
[ ] FAILURE: Build failed with an exception.
[ +1 ms] * What went wrong:
[ ] Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
[ ] > Could not resolve all dependencies for configuration ':app:debugCompileClasspath'.
[ ] > Could not create task ':app:generateDebugLintModel'.
[ ] > java.lang.NullPointerException (no error message)
[ ] * Try:
[ ] > Run with --debug option to get more log output.
[ ] > Run with --scan to get full insights.
[ ] * Exception is:
[ ] org.gradle.api.internal.tasks.TaskDependencyResolveException: Could not determine the
dependencies of task ':app:compileDebugJavaWithJavac'.
[✓] Flutter (Channel stable, 3.10.3, on macOS 13.3.1 darwin-arm64, locale ja-JP)
• Flutter version 3.10.3 on channel stable at /Users/user/development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision f92f44110e (4 days ago), 2023-06-01 18:17:33 -0500
• Engine revision 2a3401c9bb
• Dart version 3.0.3
• DevTools version 2.23.1
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at /Users/user/Library/Android/sdk
• Platform android-33, build-tools 33.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14E300c
• CocoaPods version 1.12.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.3)
• Android Studio at /Applications/Android Studio.app/Contents
• 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 11.0.13+0-b1751.21-8125866)
[✓] VS Code (version 1.73.0)
• VS Code at /Users/user/Downloads/Visual Studio Code.app/Contents
• Flutter extension version 3.60.0
[✓] Connected device (3 available)
• sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 12 (API 32) (emulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 13.3.1 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome
[✓] Network resources
• All expected network resources are available.
• No issues found!
I have tried executing commands such as 'flutter clean' and 'flutter pub cache repair,' but it did not resolve the issue. I also ran 'flutter pub outdated' and tried updating to the recommended versions as a temporary solution, but it did not make a difference.
Additional note: I have installed Java.
% brew install openjdk % sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk % echo 'export PATH="/opt/homebrew/opt/openjdk/bin:$PATH"' >> ~/.zshrc % export CPPFLAGS="-I/opt/homebrew/opt/openjdk/include"
Upvotes: 0
Views: 294
Reputation: 712
As a solution to the issue, I was able to run it without any problems by removing the "background_fetch" package
Upvotes: 0