【问题标题】:NDK files not syncing with Gradle AndroidNDK 文件未与 Gradle Android 同步
【发布时间】:2015-08-18 06:12:33
【问题描述】:

我正在 Beaglebone Black 上做一个项目,我已经在上面移植了 Android KitKat。现在我需要一个 android 应用程序,它可以帮助我访问 beaglebone 上的那些 gpios 以进行项目。

所以我使用 android studio 1.3.1 为我的项目创建应用程序,因此要通过 android 访问硬件引脚,我必须使用 NDK。现在,当我尝试将 gradle 2.2.1 与我的 NDK 文件同步时,它会打印一个错误,我应该设置 android.useDeprecatedNdk=true。现在,当我这样做时,它再次显示未定义 DeprecatedNdk() 的错误。 虽然我已经从android开发者网站下载了最新版本的NDK,即android-ndk-r10e,但错误仍然存​​在。 以下是模块中的 build.gradle 文件。

apply plugin: 'com.android.application'

android {
    compileSdkVersion 19
    buildToolsVersion "19.1.0"


 defaultConfig {
       applicationId "com.packt.gpio"
       minSdkVersion 19
       targetSdkVersion 19


       ndk {

         moduleName "packtHAL"
      }
}

buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
  }
}

dependencies {
     compile 'com.android.support:support-v4:19.+'
}

它显示的错误是:

  Error:(14, 0) Error: NDK integration is deprecated in the current plugin.  
  Consider trying the new experimental plugin.  For details, see http://tools.android.com/tech-docs/new-build-system/gradle-experimental.  
  Set "android.useDeprecatedNdk=true" in gradle.properties to continue using the current NDK integration.

如果我将属性添加到文件中,则会显示以下错误:

   Error:(6, 0) Gradle DSL method not found: 'useDeprecatedNdk()'
   Possible causes:The project 'gpio' may be using a version of Gradle that does not contain the method.
   The build file may be missing a Gradle plugin.

如果有人知道应该怎么做。请分享你的想法。

谢谢

【问题讨论】:

标签: android gradle android-ndk


【解决方案1】:

【讨论】:

  • 可以从文件 -> 其他设置 -> Android-Studio 的默认项目结构中为 NDK 添加本地 NDK 路径,但该选项似乎已禁用。知道为什么会这样吗?
猜你喜欢
  • 2013-11-24
  • 2022-01-19
  • 2018-03-11
  • 1970-01-01
  • 2016-09-24
  • 1970-01-01
  • 1970-01-01
  • 2015-07-30
相关资源
最近更新 更多