You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Android Studio Canary版本创建C++游戏活动项目时遭遇NativeSourceRootType未注册为JpsModelSerializerExtension错误求助

Android Studio Canary版本创建C++游戏活动项目时遭遇NativeSourceRootType未注册为JpsModelSerializerExtension错误求助

Hey there, sorry you're stuck with this super obscure error—total bummer when Google turns up nothing! Let's walk through what's going on and how to fix it.

First, let's break down what JpsModelSerializerExtension is: it's an internal component in IntelliJ/Android Studio that handles serializing your project's configuration (like mapping out where your NDK/C++ source files live) into a format the IDE can read and load properly. The error you're seeing means the extension responsible for recognizing NDK source root directories didn't register correctly with the IDE—this is almost certainly a bug or compatibility quirk in the Canary (pre-release) version of Android Studio you're using, since those builds are still in testing and often have rough edges.

Here are some actionable steps to try fixing this:

  • Clean cache and resync your project first
    This is the go-to fix for most IDE weirdness. Go to File → Invalidate Caches..., select Invalidate and Restart, and let the IDE reboot. Once it's back up, click File → Sync Project with Gradle Files to refresh your project configuration.

  • Verify your NDK/CMake setup
    Open your project's local.properties file and make sure the ndk.dir and cmake.dir paths point to the versions bundled with your Canary Studio (avoid using standalone/old versions of NDK here). For example:

    ndk.dir=/Users/YourUsername/Library/Android/sdk/ndk/26.1.10909125
    cmake.dir=/Users/YourUsername/Library/Android/sdk/cmake/3.22.1
    

    If the paths are wrong, update them to match the versions you have installed via the SDK Manager (Tools → SDK Manager → SDK Tools tab).

  • Downgrade your NDK version
    Canary builds sometimes have trouble with the latest NDK releases. Head to the SDK Manager, uncheck your current NDK, pick a stable older version (like 25.x series), install it, then update the ndk.dir in local.properties to point to this new version and resync.

  • Double-check your module's build.gradle config
    Open your module-level build.gradle file (not the root one) and confirm the externalNativeBuild block is set up correctly, with a CMake version that matches what you have installed:

    externalNativeBuild {
        cmake {
            path "src/main/cpp/CMakeLists.txt"
            version "3.22.1"
        }
    }
    
  • If all else fails, switch to a stable Android Studio build
    Canary builds are great for testing new features, but they're not always reliable for day-to-day work. If you need to get your project up and running quickly, download a stable release (like Giraffe or Hedgehog), import your project, and it should build without this error.

Hopefully one of these steps gets your project building smoothly!

备注:内容来源于stack exchange,提问作者ayuumu nyasu

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.15 10:24:51