diff --git a/onnxruntime/core/platform/posix/stacktrace.cc b/onnxruntime/core/platform/posix/stacktrace.cc index 73a4e2b274..8493364cc2 100644 --- a/onnxruntime/core/platform/posix/stacktrace.cc +++ b/onnxruntime/core/platform/posix/stacktrace.cc @@ -3,7 +3,9 @@ #include "core/common/common.h" +#ifndef __ANDROID__ #include +#endif #include namespace onnxruntime { @@ -11,7 +13,7 @@ namespace onnxruntime { std::vector GetStackTrace() { std::vector stack; -#ifndef NDEBUG +#if !defined(NDEBUG) && !defined(__ANDROID__) constexpr int kCallstackLimit = 64; // Maximum depth of callstack void* array[kCallstackLimit];