简体   繁体   English

在build.gradle中使用'model.android.ndk'命令

[英]Using 'model.android.ndk' command in build.gradle

I'm using gradle 4.4 and I can't the 'ndk' command is not found. 我正在使用gradle 4.4,但找不到'ndk'命令。 This is my build.gradle of the application: 这是我的应用程序的build.gradle:

 apply plugin: 'com.android.application'
apply plugin: 'cpp'


android {
    System.setProperty('SYS', 'android')
    compileSdkVersion 23
    buildToolsVersion "27.0.3"

    defaultConfig {
        applicationId "xxx"
        minSdkVersion 23
        targetSdkVersion 23
        versionCode 1
        versionName "1"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }


}
model {
    android.ndk {
        moduleName "native-lib"
      }
}

I don't know what the problem is but i get the error: 我不知道问题是什么,但出现错误:

The following model rules could not be applied due to unbound inputs and/or subjects: 由于输入和/或主题未绑定,无法应用以下模型规则:

android.ndk { ... } @ app\\build.gradle line 27, column 5 subject: - android.ndk Object [*] android.ndk {...} @ app \\ build.gradle第27行,第5栏主题:-android.ndk对象[*]

[*] - indicates that a model item could not be found for the path or type. [*]-表示找不到该路径或类型的模型项。

which refers to the line of the 'ndk' command. 指的是“ ndk”命令的行。

Thanks! 谢谢!

Google essentially discontinued the experimental NDK plugin. Google基本上停止了实验性NDK插件。 Please follow their official guide to migrate to the stable plugin: Migrate to Stable Gradle for NDK Support using CMake and ndk-build . 请遵循其官方指南以迁移到稳定的插件: 使用CMake和ndk-build迁移到Stable Gradle以获得NDK支持

If you have problems with this tutorial, and you need more guidance, please don't hesitate to ask here. 如果您对本教程有疑问,并且需要更多指导,请随时在这里提问。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM