Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
feather179 opened this issue Sep 23, 2024 · 2 comments
Labels

Comments

@feather179
Copy link

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();
@ocornut ocornut changed the title [Android] build error: ALooper_pollAll has been deprecated on Android NDK Version 27 Android backend build error: ALooper_pollAll has been deprecated on Android NDK Version 27 Sep 23, 2024
@feather179
Copy link
Author

Just change the called API from ALooper_pollAll to ALooper_pollOnce,and it works well.

@ocornut
Copy link
Owner

ocornut commented Nov 4, 2024

I have pushed the suggested change as f77d228. Thank you!

@ocornut ocornut closed this as completed Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants