简体   繁体   English

无法在 Unity 中找到 Java 和 Android SDK - Google Play 服务

[英]Unable to find Java & Android SDK - Google Play Services in Unity

I downloaded unity package for google play services.我下载了 google play 服务的统一包。 After installing the package I opened up the window for Android configuration but after putting in the Resource definition, I get several errors: that Java and Android SDK is missing and that XML resource is not correct.安装包后,我打开了 Android 配置窗口,但在输入资源定义后,我收到几个错误:缺少 Java 和 Android SDK,并且 XML 资源不正确。 I have the latest Unity version and when installing, it also installed Java and Android automatically, I didn't need to download any JDKs from java and android websites.我有最新的 Unity 版本,在安装时,它还自动安装了 Java 和 Android,我不需要从 java 和 android 网站下载任何 JDK。

What am I missing??我错过了什么??

If you go to " Edit " -> " Preferences " -> " External Tools " and scroll down to Android, there's a text field to enter the path to your SDK.如果您转到“编辑”->“首选项”->“外部工具”并向下滚动到 Android,则会有一个文本字段用于输入您的 SDK 的路径。 There's also a " Download " button next to the field that will take you directly to the download location.该字段旁边还有一个“下载”按钮,可将您直接带到下载位置。 I recommend getting all 3 (SDK, JDK, NDK).我建议获得所有 3 个(SDK、JDK、NDK)。

If the problem occurs sometimes even you already locate java sdk, just go to Assets -> External Dependency Manager -> Android Resolver on unity then click Resolve.如果即使您已经找到java sdk,有时也会出现问题,只需转到Assets -> External Dependency Manager -> Android Resolver on unity,然后单击Resolve。 Just click OK when finished now you can build apk/app bundle without java sdk locate error.现在完成后只需单击“确定”即可构建 apk/app 包,而不会出现 java sdk 定位错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM