# GameActivity 要求和兼容性

> Understand the system requirements and feature compatibility of the GameActivity application entry point.

GameActivity 具有以下依赖项：

* CMake 构建系统
* AndroidX

## CMake##unity-and-gameactivity-library-version-compatibility

GameActivity 使用 CMake 在构建过程中生成桥接代码 (`libgame.so`)。

**注意**：如果您提供自定义 Android SDK，请确保该 SDK 包含 CMake 3.22.1。

### AndroidX##cmake

GameActivity 需要以下 AndroidX Gradle 依赖项：

* `androidx.appcompat:appcompat`
* `androidx.games:games-activity`
* `androidx.core:core`
* `Androidx.constraintlayout`

Gradle 会自动安装 AndroidX 和这些依赖项。

## 插件兼容性##dependencies

如果使用 GameActivity，应用程序的播放器循环将在原生线程（而非 Java 线程）上运行。这意味着从[插件](/engine/6000.0/manual/platform-specific/android/developing/plugins-for.md)调用 [myLooper](https://developer.android.com/reference/android/os/Looper#myLooper\(\)) 等 Java API 将失败。在 `myLooper` 的情况下，这是因为原生线程上不存在 Java 循环器。这也意味着任何依赖于此类 API（如 `myLooper`）的 API 也会失败。例如，如果处理程序为 null，[registerInputDeviceListener](https://developer.android.com/reference/android/hardware/input/InputManager#registerInputDeviceListener\(android.hardware.input.InputManager.InputDeviceListener,%20android.os.Handler\)) 将失败。创建 [Android 插件](/engine/6000.0/manual/platform-specific/android/developing/plugins-for.md)时，了解此限制非常重要。

## 帧同步 (Choreographer)##plug-in-compatibility

如果使用 GameActivity，Unity 会尝试使用 [NDK 编排器](https://developer.android.com/ndk/reference/group/choreographer)来同步帧时间。如果 [Device API Level](/engine/6000.0/script-reference/unity-editor/android-sdk-versions.md) 低于 24，或者您的应用程序使用 32 位播放器并且 Device API Level 低于 29，Unity 将使用 [Java 帧同步 (Choreographer)](https://developer.android.com/reference/android/view/Choreographer)。

## 其他资源##choreographer

* [活动应用程序入口点](/engine/6000.0/manual/platform-specific/android/developing/application-entries/activity.md)
