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

React Native Android构建因NDK报错失败,求解决方案

Fixing AppCenter React Native Build Failure with NDK r17+

Hey there, let's tackle this frustrating build failure together! The error you're seeing about missing mipsel-linux-android-strip is directly tied to NDK r17 and later versions removing support for MIPS architectures—even though you've already removed armeabi from your config, there are still a few loose ends to tie up.

Why This Happens

NDK r17 completely dropped MIPS toolchains, but your build process is still trying to look for MIPS-related tools or files somewhere. This could be from leftover config, cached build artifacts, or third-party dependencies that still include MIPS binaries.

Actionable Fixes to Try

1. Pin Your NDK Version to a Pre-r17 Release

Instead of relying on the default NDK in AppCenter, explicitly specify an NDK version that still includes MIPS support (like r16b). Add this line inside your android block in build.gradle:

android {
    // ... other existing configs
    ndkVersion "16.1.4479499" // This is the version code for NDK r16b
}

You can also set this directly in AppCenter's build settings: go to your app's build configuration, find the Android section, and specify the NDK version under "Build options".

2. Exclude MIPS Architectures from Packaging

Even with abiFilters set, some third-party libraries might still bundle MIPS .so files. Add these packaging rules to your android block to explicitly exclude them:

android {
    // ... other existing configs
    packagingOptions {
        exclude "lib/mips/**"
        exclude "lib/mips64/**"
    }
}

This tells Gradle to ignore any MIPS-related native files, so it won't try to run the missing strip tool on them.

3. Clean AppCenter's Build Cache

AppCenter might be holding onto cached build artifacts from previous runs that still reference MIPS. Add a clean step to your build script to wipe these out:
In your AppCenter build configuration, under "Pre-build script", add:

./gradlew clean

This ensures you're starting with a fresh build every time.

4. Verify Third-Party Dependencies

Check if any of your installed npm packages or Android libraries are still including MIPS binaries. You can inspect the libs folders of your dependencies to see if there are mips or mips64 directories. If you find any, consider updating those dependencies to versions that have dropped MIPS support, or reach out to the package maintainers for fixes.

Final Checks

After applying these changes, re-run your AppCenter build. If it still fails, double-check that all instances of abiFilters only include architectures supported by your NDK version (x86, x86_64, armeabi-v7a, arm64-v8a for r17+).

内容的提问来源于stack exchange,提问作者Sharath Chandra

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.28 07:15:00