dotnet-maui-check icon indicating copy to clipboard operation
dotnet-maui-check copied to clipboard

Error during OpenJDK 11 check: Object reference not set to an instance

Open matthargett opened this issue 4 years ago • 7 comments

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

matthargett avatar May 03 '21 17:05 matthargett

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

mattiascibien avatar May 04 '21 08:05 mattiascibien

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.

mattiascibien avatar May 05 '21 08:05 mattiascibien

But Microsoft's OpenJDK 11 is recommended for the upcoming preview according to the mobile samples repo 🤔

@jonathanpeppers Any insight perhaps? 🙏

bddckr avatar May 05 '21 09:05 bddckr

@bddckr I'll forward to he OpenJDK team. Thanks

mattiascibien avatar May 05 '21 09:05 mattiascibien

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 avatar May 05 '21 13:05 jonathanpeppers

@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.

mattiascibien avatar May 05 '21 13:05 mattiascibien

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.

ladislauNagy avatar May 10 '21 23:05 ladislauNagy