Skip to content

[rcore][android] ALooper_pollAll has been deprecated on Android NDK Version 27 #4166

@Lewi97

Description

@Lewi97

Issue description

Compiling Raylib for android with NDK version 27 and possibly upwards will throw the following compilation error due to ALooper_pollAll having been deprecated:

[...]/raylib/platforms/rcore_android.c:586:30: 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
  586 |         while ((pollResult = ALooper_pollAll(0, NULL, &pollEvents, (void**)&platform.source)) >= 0)
      |                              ^
[...]/ndk/27.0.11902837/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)
      |     ^

Environment

IDE: Android Studio Koala | 2024.1.1 Patch 1
NDK: 27.0.11902837

  • I tested it on latest raylib version from master branch
  • I checked there is no similar issue already reported
  • I checked the documentation on the wiki
  • My code has no errors or misuse of raylib

Solution

ALooper_pollAll will have to be replaced with ALooper_pollOnce.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions