【Flutter】ビルドエラー「The operation couldn’t be completed. Unable to locate a Java Runtime」

Flutterのビルドエラー「The operation couldn’t be completed. Unable to locate a Java Runtime」について紹介します。

【1】ビルドエラー「The operation couldn’t be completed. Unable to locate a Java Runtime」

$ flutter build appbundle --release 

Building without sound null safety
For more information see https://dart.dev/null-safety/unsound-null-safety

The operation couldn’t be completed. Unable to locate a Java Runtime.   
Please visit http://www.java.com for information on installing Java.    
                                                                        
Running Gradle task 'bundleRelease'...                                  
Running Gradle task 'bundleRelease'... Done                        295ms
Gradle task bundleRelease failed with exit code 1

$ flutter doctor

[✓] Flutter (Channel stable, 2.2.2, on macOS 11.5.2 20G95 darwin-arm, locale ja-JP)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    ✗ Could not determine java version
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[!] Android Studio (version 2020.3)
    ✗ Unable to find bundled Java version.
[✓] VS Code (version 1.61.2)
[✓] Connected device (2 available)

! Doctor found issues in 2 categories. 
【Flutter入門】iOS、Android、Windowsアプリ開発
Flutterによるアプリ開発について入門者向けに紹介します。

コメント

タイトルとURLをコピーしました