React本机android构建失败,NDK错误

时间:2018-05-20 19:48:17

标签: react-native android-ndk react-native-android visual-studio-app-center

我正在使用appcenter for CI我的反应原生项目。 CI构建因错误

而失败
What went wrong:
Execution failed for task 
':app:transformNative_libsWithStripDebugSymbolForDevDebug'.
A problem occurred starting process 'command 
'/Users/vsts/Library/Android/sdk/ndk-bundle/toolchains/mipsel-linux- 
android-4.9/prebuilt/darwin-x86_64/bin/mipsel-linux-android-strip''

问题似乎是因为Android NDK升级到r17(https://github.com/facebook/react-native/issues/19321)。

我试图从我的NDK和apk拆分配置中删除armeabi。

NDK配置

android {     compileSdkVersion 27     buildToolsVersion" 26.0.2"

defaultConfig {
    applicationId "<name>"
    minSdkVersion 19
    targetSdkVersion 27
    versionCode 2
    versionName "1.0.1"
    ndk {
        abiFilters "x86"
    }
    vectorDrawables.useSupportLibrary = true
    multiDexEnabled true
}

拆分配置是

splits {
    abi {
        reset()
        enable enableSeparateBuildPerCPUArchitecture
        universalApk false  // If true, also generate a universal APK
        include "x86"
    }
}


applicationVariants.all { variant ->
    variant.outputs.each { output ->
        // For each separate APK per architecture, set a unique version code as described here:
        // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
        def versionCodes = ["x86":2]
        def abi = output.getFilter(OutputFile.ABI)
        if (abi != null) {  // null for the universal-debug, universal-release variants
            output.versionCodeOverride =
                    versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
        }
    }
}

构建仍然无法正常工作。

任何变通办法都会非常有用。

0 个答案:

没有答案