Arcore-unity-sdk: JDK and Android SDK errors.

Created on 13 Jun 2019  路  6Comments  路  Source: google-ar/arcore-unity-sdk

SPECIFIC ISSUE ENCOUNTERED

Below error pops up when I "play" a scene with ARCore (HelloAR, in this case), and the console errors (also shown below) when I build it. Checked with a simple Android build, without the ARCore SDK, the error doesn't occur.

error

consoleError

Error: A JDK path needs to be specified for the Android Build

The JDK has been installed using the Unity installer, which is the recommended method:

preferences**

For some reason, ARCore is unable to detect the JDK on its own, when it has been installed via Unity

I'm not sure what I'm missing here. Does ARCore SDK not support the JDK with Unity?

Edit:
Given the same settings as before, I am also encountering the below issue, thrown by Instant Preview. The Android SDK is not being detected.

SDK error

VERSIONS USED

  • Unity: 2019.1.0f2
  • ARCore SDK for Unity: 1.9.0
  • Device manufacturer, model, and O/S: Unity Editor issue, Windows 10

STEPS TO REPRODUCE THE ISSUE

  1. Load ARCore unitypackage into empty project
  2. Open HelloAR scene (or any example scene)
  3. Play the scene/build the project.

WORKAROUNDS (IF ANY)

Configuring the JDK/SDK path manually.

Most helpful comment

One workaround I found is to uncheck JDK/SDK installed with Unity, click on both browse button so that the path filled automatically and then re-check the checkbox.

All 6 comments

Configuring the JDK/SDK path manually.

One workaround I found is to uncheck JDK/SDK installed with Unity, click on both browse button so that the path filled automatically and then re-check the checkbox.

Thank you, @miner46er . That works.

But shouldn't it happen automatically?

On digging around a bit, I found that both the JDK path and Android SDK path are being set via Unity's EditorPrefs:

JDK Path:
CloudAnchorPreprocessBuild.cs script (line 52):

var jdkPath = UnityEditor.EditorPrefs.GetString("JdkPath");

SDK Path:
ShellHelper.cs script (line 84):

sdkRoot = EditorPrefs.GetString("AndroidSdkRoot");

If I'm guessing right, these are not being correctly referred to. I'm not sure if anything has changed from Unity's end.

You're welcome, @itssmutnuri.

Yeah, I found that too. Apparently when you tick "JDK/SDK installed with Unity" checkboxes, Unity doesn't automatically set the proper value to JdkPath and AndroidSdkRoot.

@xiaomaogy

Why did I get @ here @victor871129 ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iBicha picture iBicha  路  4Comments

tavilad picture tavilad  路  6Comments

joshliebe picture joshliebe  路  3Comments

bourgeoismaxime picture bourgeoismaxime  路  6Comments

ArigarasuthanRepo picture ArigarasuthanRepo  路  5Comments