在实现Project时,我面对的是“您的项目包含C ++文件,但它没有使用受支持的本机构建系统。”

时间:2016-11-07 09:10:14

标签: android android-studio android-gradle gradle-plugin

错误:任务':app:compileDebugNdk'执行失败。

  

错误:您的项目包含C ++文件,但它没有使用受支持的本机构建系统。   考虑使用CMake或ndk-build与稳定的Android Gradle插件集成:    https://developer.android.com/studio/projects/add-native-code.html   或使用实验插件:    http://tools.android.com/tech-docs/new-build-system/gradle-experimental

1 个答案:

答案 0 :(得分:4)

android.useDeprecatedNdk=true

中添加gradle.properties

这是我的

  # Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

android.useDeprecatedNdk=true