FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':shared_preferences:compileDebugJavaWithJavac'. Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_261 contains a valid JDK installation.
What I tried:
Run with --stack trace 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
- List item
BUILD FAILED in 1m 37s Exception: Gradle task assemble Debug failed with exit code 1
When I run flutter doctor -v
G:\projectname>flutter doctor -v
[√] Flutter (Channel beta, 1.22.1, on Microsoft Windows [Version 10.0.19041.572], locale en-US)
• Flutter version 1.22.1 at C:\src_vscode\flutter
• Framework revision f30b7f4db9 (12 days ago), 2020-10-08 10:06:30 -0700
• Engine revision 75bef9f6c8
• Dart version 2.10.1
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
• Android SDK at C:\Users\Waqas Hameed\AppData\Local\Android\sdk
• Platform android-30, build-tools 30.0.1
• Java binary at: C:\Program Files\Java\jre1.8.0_261\bin\java
• Java version Java(TM) SE Runtime Environment (build 1.8.0_261-b12)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
[√] VS Code (version 1.50.1)
• VS Code at C:\Users\Waqas Hameed\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.15.1
[√] Connected device (4 available)
• AOSP on IA Emulator (mobile) • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)
• Web Server (web) • web-server • web-javascript • Flutter Tools
• Chrome (web) • chrome • web-javascript • Google Chrome 86.0.4240.75
• Edge (web) • edge • web-javascript • Microsoft Edge 86.0.622.38
! Doctor found issues in 1 category.