dotnet-maui-check
dotnet-maui-check copied to clipboard
Error during OpenJDK 11 check: Object reference not set to an instance
Fails every time I try it, Windows 10 Version 10.0.19043.964. All other checks and installs work fine. 'redth.net.maui.check' (version '0.4.2')
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
☼ Recommendation: Install OpenJDK11
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
! Attempt to fix? [y/n] (y): y
» Attempting to fix: OpenJDK 1.8.0-1
Installing Download and Install Microsoft OpenJDK 11...
Fix failed - Object reference not set to an instance of an object.
> Visual Studio 16.9.0 Checkup...
- 16.9.4 - C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
x Skipped: Android SDK
x Skipped: Android Emulator
Happenend to me too. Problem is that OpenJDK 11, even after downloading it manually, still cannot use Android SDK. https://github.com/microsoft/openjdk/discussions/42#discussioncomment-690121
It seems that JDK 11 is not supported by android, so it is better to rely on JDK8?
https://github.com/microsoft/openjdk/discussions/42#discussioncomment-694829 Here the answer from the MS OpenJDK team.
But Microsoft's OpenJDK 11 is recommended for the upcoming preview according to the mobile samples repo 🤔
@jonathanpeppers Any insight perhaps? 🙏
@bddckr I'll forward to he OpenJDK team. Thanks
VS 2019 16.10 Preview 3 and .NET 5 Preview 4 will have support for the new Microsoft OpenJDK11. Neither of these previews are actually out yet, but you can get builds for them.
The error above looks like a general problem in the maui-check tool?
@jonathanpeppers yes. I had other problems with JDK11 when creating the emulator with maui-check. I thought they may be correlated as the OpenJDK team told me to use JDK 8 instead of 11.
It started working for me after I installed the VS Mobile development with .Net component. Make sure that Android SDK setup (API level 30) is checked tough.
It would be better if this error would be handled and print something more useful for this case.