Execution failed for task ‘:demo:stripReleaseDebugSymbols‘.

行浪發表於2020-10-28

> Task :demo:stripReleaseDebugSymbols FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':demo:stripReleaseDebugSymbols'.
> 1 exception was raised by workers:
  org.gradle.process.internal.ExecException: A problem occurred starting process 'command '/mnt/c/Users/***/AppData/Local/Android/Sdk/ndk/21.0.6113669/toolchains/aarch64-linux-android-4.9/prebuilt/windows-x86_64/bin/aarch64-linux-android-strip''

 

我是在WSL下執行gradlew命令的,而使用的是Windows下的Android NDK,至少這個版本是不沒有aarch64-linux-android-strip的,所以沒法編譯通過。

可以參考的解決辦法是,在模組的build.gradle檔案中android節點新增上packagingOptions節點,並配置doNotStrip屬性:

android {
    packagingOptions {
        doNotStrip '**/*.so'
    }
}

當然這只是臨時解決辦法,只是避免了strip,正式釋出不要這樣做哦。

相關文章