I was using Eclipse successfully to build Botan using the directions linked to from this question, however, Android Studio is supposed to replace Eclipse for Android development, so I'm trying to get it to build in Android Studio now, but it fails with a missing header file <iosfwd>
. I'm getting the following error:
Error:Execution failed for task ':app:compileDebugNdk'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
/Users/User1/Development/android-ndk-r10d/ndk-build NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/Users/User1/application1/android/workspace/app/build/intermediates/ndk/debug/Android.mk APP_PLATFORM=android-19 NDK_OUT=/Users/User1/application1/android/workspace/app/build/intermediates/ndk/debug/obj NDK_LIBS_OUT=/Users/User1/application1/android/workspace/app/build/intermediates/ndk/debug/lib APP_ABI=all
Error Code:
2
Output:
In file included from /Users/User1/application1/android/workspace/app/src/main/jni/botan/botan_all.cpp:8:0:
/Users/User1/application1/android/workspace/app/src/main/jni/botan/botan_all.h:11:18: fatal error: iosfwd: No such file or directory
#include <iosfwd>
^
compilation terminated.
make: *** [/Users/User1/application1/android/workspace/app/build/intermediates/ndk/debug/obj/local/arm64-v8a/objs/app//Users/User1/application1/android/workspace/app/src/main/jni/botan/botan_all.o] Error 1
Where should I be getting the header file <iosfwd>
from and how do I instruct Android Studio to locate it?
Update
I found the following makefile: .../workspace/app/src/main/jni/botan/Android.mk
# jni/botan/Android.mk:
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := botan
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
LOCAL_SRC_FILES := botan_all.cpp
LOCAL_CPPFLAGS := -DBOTAN_USE_GCC_INLINE_ASM=0
include $(BUILD_SHARED_LIBRARY)
I tried adding the line after LOCAL_CPPFLAGS
:
LOCAL_C_INCLUDES := $(ANDROID_STL_INC)
But the build seems unaffected, I get the same error, so I then tried to edit LOCAL_CPPFLAGS
to be:
LOCAL_CPPFLAGS := SEE_IF_THIS_BREAKS_THE_BUILD
To see if my edits are being seen, but again, the exact same original failure on header iosfwd
. So it appears my edits are not part of the build.
How can I get Android Studio to give more information so I can figure out how it gets to the build step that fails. Presently, when I build, it pauses, then gives window with the error message, but without showing all the intermediate steps to get it there, which might show which makefiles got it to that point.