我想在手机上测试我的flutter应用。所以我试着建立一个apk。我在应用文件中运行了这个:
flutter build apk --split-per-abi
结果:
Building with sound null safety
FAILURE: Build failed with an exception.
* What went wrong:
The supplied javaHome seems to be invalid. I cannot find the java executable. Tried location: C:\Program Files\Java\jre1.8.0_51\bin\java.exe
* 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
Running Gradle task 'assembleRelease'... 4,0s
Gradle task assembleRelease failed with exit code 1
如果我理解正确,它找不到java。因为C:\Program Files\Java\jre1.8.0_51\bin
路径是空的。我试着卸载和重新安装java。但结果是一样的。我怎么能解决这个问题,并建立在我的手机测试apk?
1条答案
按热度按时间z4bn682m1#
您只安装了Java JRE(java运行时环境)。请安装完整的java SDK。在环境变量中添加SDK路径作为JAVA_HOME变量。