Unity无法列出目标平台 [英] Unity unable to list target platforms

查看:211
本文介绍了Unity无法列出目标平台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Unity上有些新工作,并且开发了VR游戏,一切顺利,直到我尝试在构建设置"中创建apk为止.我收到此错误:

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:

控制台登录统一为:

我搜索了相同的主题,并尝试替换sdk根目录下的"Tools"文件夹,但仍然遇到问题.如果有人可以帮助我,我将不胜感激.

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.

推荐答案

我有相同的错误.我必须设置一些环境变量并重新启动Unity才能使其正常工作:

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

  • 将环境变量JAVA_HOME设置为JDK位置.
  • 将环境变量ANDROID_HOME设置为Android SDK位置.
  • 将环境变量ANDROID_NDK_HOME设置为Android NDK位置.
  • 将JDK工具目录添加到您的PATH中,即C:\ Program Files \ Android Studio \ jre \ bin.
  • 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.

来源: Oculus Android开发软件设置

您似乎在Mac上,因此要设置环境变量,请参见

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

要在Windows 10中编辑环境变量,请执行以下操作:Windows设置>查找设置>为您的帐户编辑环境变量(或编辑系统环境变量).

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

这篇关于Unity无法列出目标平台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆