android - 我在哪里可以找到 Mac 中的 local.properties 文件?

标签 android unity-game-engine

我正在 Android 平台的 Unity-Mac 中实现 DeltaDna 智能广告。 https://github.com/deltaDNA/unity-sdk

要实现智能广告,我们需要打开命令行并运行 python download.py。这将下载依赖的 AAR 和 Jar 文件并将其复制到 Assets\DeltaDNAAds\Plugins\Android 文件夹中。当您构建 APK 时,Unity 会选择这些。

但是我得到了这个错误。

SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

我在哪里可以找到这个 local.properties 文件?

最佳答案

Android Studio 为您创建。

它们看起来像这样,位于 Android 项目的根目录中。

## This file is automatically generated by Android Studio.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Mon May 09 15:14:03 BST 2016
sdk.dir=/Users/{username}/Library/Android/sdk

当你通过 unity 构建时,我猜你不需要担心它,只需要在“Unity/Preferences”中设置 android sdk 位置 --> 外部工具

或者通过 bash 将 ANDROID_HOME 设置为预构建步骤

ANDROID_HOME=/Users/{username}/Library/Android/sdk export         
PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

谢谢

关于android - 我在哪里可以找到 Mac 中的 local.properties 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38455272/

相关文章:

android - 如何将带有上下文的文本复制到剪贴板

java - Android:如何将位图的百分比设为黑白,其余部分保留颜色?

unity-game-engine - Unity : transform. GetComponent 与。游戏对象.GetComponent?

c# - 最新版本的 Unity 和 Google 无法生成 APK 构建并显示 Android Manifestation 脚本错误

unity-game-engine - 如何将 vuforia 与声音结合使用

java - 使用连接后需要调用java.net.HttpURLConnection.disconnect()?

android - 当用户使用 firebase 单击按钮时向其他用户发送通知

android - 在 Android 上显示点击覆盖,例如基线网格

android - 如何使用 Unity 3D 在 Android 应用程序运行时从云/WEB 访问纹理/模型?

browser - Blender 与 Unity