我正在使用Macbook电脑。我已经下载了Android NDK并将其解压到了电脑上。
~/mytool/android-ndk-r10e
在.bash_profile文件中,我已经设置了:
export ANDROID_HOME=~/Library/Android/sdk
export ANDROID_NDK_HOME = ~/mytool/android-ndk-r10e
我的项目pom.xml文件中包含以下插件:
<plugin>
<groupId>com.simpligility.maven.plugins</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>4.3.0</version>
<extensions>true</extensions>
</plugin>
当我运行
mvn clean install
命令时,我遇到了下面的错误:[ERROR] Failed to execute goal com.simpligility.maven.plugins:android-maven-plugin:4.3.0:ndk-build (default-ndk-build) on project MyTrackor: No Android NDK path could be found.
You may configure it in the pom using <ndk><path>...</path></ndk> or <properties><ndk.path>...</ndk.path></properties> or on command-line using -Dandroid.ndk.path=... or by setting environment variable ANDROID_NDK_HOME -> [Help 1]
上述错误提示没有找到Android NDK路径,并建议我设置环境变量ANDROID_NDK_HOME
来解决问题。
但是如您所见在我的.bash_profile中,我已经设置了环境变量ANDROID_NDK_HOME
。为什么我仍然会遇到这个错误?
bash_profile
吗?尝试强制执行并在终端内执行 export 命令。 - Simon Marquis