Skip to content

Android backend build error: ALooper_pollAll has been deprecated on Android NDK Version 27 #8013

Closed
@feather179

Description

@feather179

Version/Branch of Dear ImGui:

Version 1.90, Branch: master

Back-ends:

imgui_impl_android.cpp + imgui_impl_opengl3.cpp

Compiler, OS:

Android Studio with NDK version 27.1.12297006

Full config/build information:

No response

Details:

D:\Android\Sdk\ndk\27.1.12297006\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=aarch64-none-linux-android24 --sysroot=D:/Android/Sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/windows-x86_64/sysroot -DIMGUI_IMPL_OPENGL_ES3 -DImGuiExample_EXPORTS -ID:/imgui-1.90/examples/example_android_opengl3/../.. -ID:/imgui-1.90/examples/example_android_opengl3/../../backends -ID:/Android/Sdk/ndk/27.1.12297006/sources/android/native_app_glue -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security   -fno-limit-debug-info  -std=c++11 -fPIC -MD -MT CMakeFiles/ImGuiExample.dir/main.cpp.o -MF CMakeFiles\ImGuiExample.dir\main.cpp.o.d -o CMakeFiles/ImGuiExample.dir/main.cpp.o -c D:/imgui-1.90/examples/example_android_opengl3/main.cpp

D:/imgui-1.90/examples/example_android_opengl3/main.cpp:98:16: error: 'ALooper_pollAll' is unavailable: obsoleted in Android 1 - ALooper_pollAll may ignore wakes. Use ALooper_pollOnce instead. See The API documentation for more information
   98 |         while (ALooper_pollAll(g_Initialized ? 0 : -1, nullptr, &out_events, (void**)&out_data) >= 0)
      |                ^
D:/Android/Sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/android/looper.h:228:5: note: 'ALooper_pollAll' has been explicitly marked unavailable here
  228 | int ALooper_pollAll(int timeoutMillis, int* outFd, int* outEvents, void** outData)
      |     ^

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

// Here's some code anyone can copy and paste to reproduce your issue
ImGui::Begin("Example Bug");
MoreCodeToExplainMyIssue();
ImGui::End();

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions