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

标签 android gradle android-ndk android-gradle-plugin java-native-interface

我正在使用gradle 4.4,但找不到'ndk'命令。这是我的应用程序的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"
      }
}

我不知道问题是什么,但出现错误:

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 [*]

[*] - indicates that a model item could not be found for the path or type.



指的是“ndk”命令的行。

谢谢!

最佳答案

Google基本上停止了实验性NDK插件。请按照其官方指南迁移到稳定的插件Migrate to Stable Gradle for NDK Support using CMake and ndk-build

如果您对本教程有疑问,并且需要更多指导,请随时在这里提问。

关于android - 在build.gradle中使用 'model.android.ndk'命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49733404/

相关文章:

scala - 用gradle编译scala项目:MissingRequirementError

java.lang.UnsatisfiedLinkError : Couldn't load eposprint: findLibrary returned null 错误

java - 另一种方式是发布请求

android - 删除 map 中的叠加层

android - 只想在运行单元测试时运行自定义 gradle 任务

android-ndk - genymotion ARM 翻译 : "…/lib/arm/libndk.so" has unexpected e_machine: 40

安卓 ndk-r8 "error trying to exec ' cc1plus' : execvp: No such file or directory"

android - 在 Android 上旋转大图像

android - Invalid Key Hash Facebook,设置中提供的 key 哈希是正确的

java - Gradle - Java 项目的多重依赖关系