1

I'm a little bit new working on Unity and I've developed a VR game, everything goes well until I try to create the apk in the Build Settings. I got this error:

Error Log1

The console Log in unity is this:

Console Log

I've searched the same topic and tried replacing the "Tools" folder of my sdk root but still got the problem. If anyone can help me I would appreciate it.

  • The issue seems to arise even when fixed. Can you try the solution from [this](https://stackoverflow.com/a/37314122/3785314) answer? – Programmer Feb 09 '18 at 23:42
  • 1
    if you have jdk9, downgrade to jdk1.8.x https://forum.unity.com/threads/java-9-jdk-9-support-by-unity-android.499354/ – mgear Feb 10 '18 at 04:04

2 Answers2

3

I had the same error. I had to set some environment variables and restart Unity in order to get it to work:

  • Set the environment variable JAVA_HOME to the JDK location.
  • Set the environment variable ANDROID_HOME to the Android SDK location.
  • Set the environment variable ANDROID_NDK_HOME to the Android NDK location.
  • Add the JDK tools directory to your PATH, ie C:\Program Files\Android Studio\jre\bin.

Source: Oculus Android Development Software Setup

It looks like you're on a Mac, so to set environment variables, see How do I set environment variables on OS X?

To edit environment variables in Windows 10: Windows Settings > Find a setting > Edit environment variables for your account (or Edit the system environment variables).

Mike Henry
  • 2,401
  • 1
  • 25
  • 34
1

Finally found a fix that worked for me!

https://answers.unity.com/questions/1320150/unable-to-list-target-platform.html