我正在 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/