Android ndk build mysteriously failing under cygwin with “Error 126”

允我心安 提交于 2019-12-23 05:27:46

问题


I have a JNI application built by ndk-build (using Android NDK r5b and cygwin make 3.81). The build usually works, by occasionally fails with:

...
Compile++ thumb  : components <= Component.cpp
make: *** [/c/.hudson/jobs/Nightly/workspace/application/obj/local/armeabi/objs/components/Component.o] Error 126
make: Leaving directory `/c/.hudson/jobs/Nightly/workspace/application/obj/local/armeabi/objs/components'

There is no other error. Make than exits with status 2. It happens in different file each time (the name above is anonymized). It seems to happen more often with parallel builds, but sometimes happens with non-parallel builds too.

Does anybody have an idea what it might be or at least how to debug it?


回答1:


Make error 126 is permission denied. Do you run antivirus software? IF so, maybe it is locking files or preventing writes, and therefore causing errors? If you do not have antivirus software on, maybe you have another software which might be acquiring file locks?




回答2:


The only way I've found to prevent this (and its sister error, make error 127) from occurring in our build is to set make's maximum number of simultaneous jobs to 1.

To do this, run make with the command-line parameters "-j 1", e.g.:

make -j 1 CONFIG=debug



回答3:


When this happens to me, I usually just delete the object files associated with the error (in your case Component.o and Component.o.d) then rebuild.



来源:https://stackoverflow.com/questions/5256963/android-ndk-build-mysteriously-failing-under-cygwin-with-error-126

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!