Error:Execution failed for task ':library:compileReleaseNdk'解决方案

自己在研究GPUImage滤镜效果时遇到的坑,记录下:

1、首先下载GPUImage相关的源码及demo,导入android studio报如下错误:

Error:Execution failed for task ':library:compileReleaseNdk'.
> Error: Your project contains C++ files but it is not using a supported native build system.
Consider using CMake or ndk-build integration with the stable Android Gradle plugin:
 https://developer.android.com/studio/projects/add-native-code.html
or use the experimental plugin:
 https://developer.android.com/studio/build/experimental-plugin.html.

解决办法:在项目的gradle.properties文件中加入这句

android.useDeprecatedNdk=true

Error:Execution failed for task ':library:compileReleaseNdk'解决方案_第1张图片

2、再次编译,如果还有问题:

解决方法:在你导入的包含jni的库的build.gradle文件中加入这句

sourceSets.main {
    jni.srcDirs = []
}

Error:Execution failed for task ':library:compileReleaseNdk'解决方案_第2张图片

注意是在android{  ...  }之间加即...的地方加,问题就可以解决了,自己踩过的坑,希望可以帮到你

你可能感兴趣的:(Error:Execution failed for task ':library:compileReleaseNdk'解决方案)