NDK_PROJECT_PATH =在Android Studio 3.1.2上为空 [英] NDK_PROJECT_PATH=null on Android Studio 3.1.2
问题描述
我正在尝试构建一个涉及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)
我正确地遵循了建筑注释.在Android Studio中加载项目时,会出现一些错误:
I followed the BUILDING note correctly. When the project is loaded in Android Studio, there are some errors:
构建命令失败.
Build command failed.
执行时出错 'C:\ Users \ Cipta-NB \ AppData \ Local \ Android \ Sdk \ ndk-bundle \ ndk-build.cmd' 带有参数{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:/用户/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}
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构建 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 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?
推荐答案
-
NDK_PROJECT_PATH=null
是红色鲱鱼.看起来真令人震惊.这不是错误.这就是在Android Studio中配置NDK构建的方式.
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.
这篇关于NDK_PROJECT_PATH =在Android Studio 3.1.2上为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!