【问题标题】:Update gradle ndk in android studio在 android studio 中更新 gradle ndk
【发布时间】:2018-02-10 07:55:41
【问题描述】:

我尝试使用EasyAr 库为安卓构建增强现实应用程序。我遵循Import EasyAr Android SDK 教程,但问题是ndk 部分出错。我还将jniLibrary 文件添加到jniLibs 文件夹并删除android.source 部分。

我的应用 build.gradle 文件:

apply plugin: 'com.android.application'

android {

    ... -> Default configuration

    ndk{
        moduleName "HelloARNative"
        cppFlags.add("-I${file("../../../../easyAr/include")}".toString())
        cppFlags.add("-DANDROID")
        cppFlags.add("-fexceptions")
        cppFlags.add("-frtti")
        stl = "gnustl_static"
        ldLibs.add("log")
        ldLibs.add("GLESv2")
    }
}

dependencies {
    ... -> Some dependencies
}

EDIT1: 错误按摩:

Error:(19, 0) Could not find method ndk() for arguments [build_35mhq15314xxy8foo9ao90j63$_run_closure1$_closure5@793f61be] on object of type com.android.build.gradle.AppExtension.
<a href="openFile:/Users/saman/Downloads/ARtoolkit/AndroidStudioProjects/EasyArProject/app/build.gradle">Open File</a>

【问题讨论】:

标签: android gradle android-ndk


【解决方案1】:

本教程基于 Android NDK 的 experimental gradle 插件。现在,建议使用 stable 插件。这涉及编写 Android.mkcmake 脚本。谷歌已发布these instructions。 EasyAr 更新教程的时机也已经成熟。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-05-16
    • 2015-07-29
    • 2014-01-22
    • 2013-07-17
    • 2016-01-19
    • 2019-03-05
    • 1970-01-01
    • 2017-09-19
    相关资源
    最近更新 更多