Run Build Command(s):D:\Android\AndroidSdk\cmake\3.22.1\bin\ninja.exe cmTC_1e3b7 && [1/2] Building C object CMakeFiles/cmTC_1e3b7.dir/testCCompiler.c.o [2/2] Linking C executable cmTC_1e3b7 FAILED: cmTC_1e3b7 cmd.exe /C "cd . && D:\Android\AndroidSdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe --target=aarch64-none-linux-android30 --sysroot=D:/Android/AndroidSdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/sysroot -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fexceptions -O2 -g -DNDEBUG -Wl,--build-id=sha1 -Wl,--fatal-warnings -Qunused-arguments -Wl,--no-undefined -Wl,--gc-sections CMakeFiles/cmTC_1e3b7.dir/testCCompiler.c.o -o cmTC_1e3b7 -latomic -lm && cd ." ld: error: failed to write to the output file: Permission denied clang: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed.ref:
- Android NDK Build: ld: error: failed to write to the output file: Permission denied
- 记录一次Android Studio NDK 编译权限问题:他最後去下載了ndk-21, 發現這個是LTS
You are correct. ProcessMonitor seems to indicate that in NDK version 23.1.7779620 the ld.exe is using a newer API calls that are not supported on Win7.
enter image description here
It looks like ld erroneously interprets the failed API call as a "permission denied" error. The same happens in NDK version 23.0.7599858.
The last NDK that seems to work on Win7 is 22.1.7171670.
After the system was upgraded to Win10 ld started to work normally for the 23.x NDK versions.
但是最新版的android studio 好像不允許自行決定 ndk 位置,而且每次都會自動更新到最新版..
到這邊(archive) 才能下載到舊板。
沒有留言:
張貼留言