Android Studio 3.1.2 上的 NDK_PROJECT_PATH=null [英] NDK_PROJECT_PATH=null on Android Studio 3.1.2

查看:43
本文介绍了Android Studio 3.1.2 上的 NDK_PROJECT_PATH=null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建一个涉及 NDK 的 Android 项目:CoolMicApp-Android(已经安装了最新的 Android Studio 和 NDK)

I'm trying to build an Android projects which involves NDK: CoolMicApp-Android (already have the latest Android Studio and NDK installed)

我正确地遵循了BUILDING 说明.在Android Studio中加载项目时,出现一些错误:

I followed the BUILDING note correctly. When the project is loaded in Android Studio, there are some errors:

构建命令失败.

执行时出错'C:\Users\Cipta-NB\AppData\Local\Android\Sdk\ndk-bundle\ndk-build.cmd'带参数 {NDK_PROJECT_PATH=nullAPP_BUILD_SCRIPT=C:\Users\Cipta-NB\StudioProjects\CoolMicApp-Android\app\src\main\jni\Android.mkNDK_APPLICATION_MK=C:\Users\Cipta-NB\StudioProjects\CoolMicApp-Android\app\src\main\jni\Application.mkAPP_ABI=armeabi NDK_ALL_ABIS=armeabi NDK_DEBUG=0APP_PLATFORM=android-16NDK_OUT=C:/Users/Cipta-NB/StudioProjects/CoolMicApp-Android/app/build/intermediates/ndkBuild/release/objNDK_LIBS_OUT=C:\Users\Cipta-NB\StudioProjects\CoolMicApp-Android\app\build\intermediates\ndkBuild\release\libAPP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}

Error while executing 'C:\Users\Cipta-NB\AppData\Local\Android\Sdk\ndk-bundle\ndk-build.cmd' with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\Cipta-NB\StudioProjects\CoolMicApp-Android\app\src\main\jni\Android.mk NDK_APPLICATION_MK=C:\Users\Cipta-NB\StudioProjects\CoolMicApp-Android\app\src\main\jni\Application.mk APP_ABI=armeabi NDK_ALL_ABIS=armeabi NDK_DEBUG=0 APP_PLATFORM=android-16 NDK_OUT=C:/Users/Cipta-NB/StudioProjects/CoolMicApp-Android/app/build/intermediates/ndkBuild/release/obj NDK_LIBS_OUT=C:\Users\Cipta-NB\StudioProjects\CoolMicApp-Android\app\build\intermediates\ndkBuild\release\lib APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}

Android NDK:内部错误:armeabi ABI 应该正好有一个架构定义.发现:''

Android NDK: INTERNAL ERROR: The armeabi ABI should have exactly one architecture definitions. Found: ''

process_begin: CreateProcess(NULL, "", ...) 失败.

process_begin: CreateProcess(NULL, "", ...) failed.

*** Android NDK:正在中止... .停止.打开文件

*** Android NDK: Aborting... . Stop. Open File

C 库可以通过运行这个命令成功构建:

The C libs can be built successfully by running this command, though:

ndk-buildNDK_APPLICATION_MK=C:\Users\Cipta-NB\StudioProjects\CoolMicApp-Android\app\src\main\jni\Application.mkNDK_PROJECT_PATH=C:\Users\Cipta-NB\StudioProjects\CoolMicApp-Android\app\src\main

ndk-build NDK_APPLICATION_MK=C:\Users\Cipta-NB\StudioProjects\CoolMicApp-Android\app\src\main\jni\Application.mk NDK_PROJECT_PATH=C:\Users\Cipta-NB\StudioProjects\CoolMicApp-Android\app\src\main

在我的笔记本电脑中,ndk-build 位于 C:\Users\Cipta-NB\AppData\Local\Android\Sdk\ndk-bundle.创建名为 NDK_PROJECT_PATH 的环境变量并重新启动 Android Studio 并不能解决问题.

In my laptop, ndk-build is located in C:\Users\Cipta-NB\AppData\Local\Android\Sdk\ndk-bundle. Creating an environment variable called NDK_PROJECT_PATH and restarting Android Studio doesn't solve the problem.

这是项目目录下local.propertes文件的内容:

This is the content of local.propertes file in the project directory:

ndk.dir=C:\Users\Cipta-NB\AppData\Local\Android\Sdk\ndk-bundle

ndk.dir=C:\Users\Cipta-NB\AppData\Local\Android\Sdk\ndk-bundle

sdk.dir=C:\Users\Cipta-NB\AppData\Local\Android\Sdk

sdk.dir=C:\Users\Cipta-NB\AppData\Local\Android\Sdk

这是Application.mk的内容

And this is the content of Application.mk

APP_ABI := armeabi-v7a

APP_ABI := armeabi-v7a

APP_PLATFORM := android-14

APP_PLATFORM := android-14

有什么(简单的)解决方法吗?

Is there any (easy) workaround?

推荐答案

  1. NDK_PROJECT_PATH=null 是一个红鲱鱼.它只是看起来令人担忧.这不是错误.这就是在 Android Studio 中配置 NDK 构建的方式.

  1. NDK_PROJECT_PATH=null is a red herring. It only looks alarming. It's not an error. This is how NDK build is configured in Android Studio.

最新的 NDK r17 不再支持某些 ABI.不幸的是,旧的 Gradle 插件不知道这一点.您可以通过调整您的 build.gradle 脚本,但升级插件更容易、更安全.

The latest NDK r17 dropped support for some ABIs. Unfortunately, the old Gradle plugin does not know that. You can resolve this inconsistency by tuning your build.gradle script, but upgrading the plugin is easier and safer.

这篇关于Android Studio 3.1.2 上的 NDK_PROJECT_PATH=null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆