简体   繁体   English

在Android Studio中更新Gradle NDK

[英]Update gradle ndk in android studio

I try to use EasyAr library for build an augmented reality application for android. 我尝试使用EasyAr库为Android构建增强现实应用程序。 i follow Import EasyAr Android SDK tutorial but problem is ndk part make error. 我遵循Import EasyAr Android SDK教程,但问题是ndk部分出错。 Also i add jniLibrary files to jniLibs folder and remove android.source part. 我也将jniLibrary文件添加到jniLibs文件夹并删除android.source部分。

My app build.gradle file: 我的应用程序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 massage: 编辑1 :错误消息:

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>

This tutorial is based in the experimental gradle plugin for Android NDK. 本教程基于适用于Android NDK的实验性 Gradle插件。 Nowadays, it is recommended to use the stable plugin instead. 如今,建议改为使用稳定插件。 This involves writing Android.mk or cmake script . 这涉及编写Android.mkcmake脚本 Google has published these instructions . Google已发布了这些说明 The time is ripe for EasyAr to update their tutorial, too. EasyAr更新其教程的时机也已成熟。

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

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