Android Studio 프로젝트에서 ndk-build 용 PATH 변수를 인식하지 못합니다. 아래 build.gradle에서 발췌 한 것입니다Android Studio에서 경로 변수가 인식되지 않습니다 (ndk-build 명령이 인식되지 않습니다)
stpns-MacBook-Pro:~ stepanboltalin$ ndk-build
Android NDK: Could not find application project directory !
Android NDK: Please define the NDK_PROJECT_PATH variable to point to it.
/usr/local/Cellar/android-ndk/r10b/build/core/build-local.mk:148: *** Android NDK: Aborting . Stop.
을하지만 안드로이드 Studio에서 프로젝트를 컴파일하려고하면, 나는 'NDK 빌드'commmandLine (에서 오류가 발생합니다 :
내가 터미널에서 ndk-build
를 실행하면 내가 얻을 :
task ndkBuild(type: Exec) {
# some stuff...
if (ant.properties.os == 'windows') {
commandLine 'ndk-build.cmd'
} else {
commandLine 'ndk-build'
}
}
는 이제 추가하면 절대 경로의 모든 작동 :
task ndkBuild(type: Exec) {
# some stuff...
if (ant.properties.os == 'windows') {
commandLine 'ndk-build.cmd'
} else {
commandLine '/usr/local/opt/ndk-build'
}
}
문제는 겉으로보기에는 해결되었지만 개발과 같은 build.gradle은 차선책입니다. 이 문제를 어떻게 해결할 수 있습니까?
을 어디에서 할 '/ use/local/opt/ndk'를 PATH에 추가 하시겠습니까? '~/.profile'이어야합니다. –
예 .bash_profile 및 .profile을 시도했습니다. – Stpn
. 명령 줄에서 AS를 실행하지 않았으므로 .bash_profile은 좋지 않습니다. –