Android Studio 2.2 原生开发迁移问题 [英] Android Studio 2.2 Native Development Migration Issue

查看:20
本文介绍了Android Studio 2.2 原生开发迁移问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在切换到 AS 2.2 之前,我有以下结构来实现我的 C

Before making the switch to AS 2.2, I have the following structure to implement my C

app/src/main/jni/Android.mk
app/src/main/jni/Application.mk
app/src/main/jni/headers/*
app/src/main/jni/cfiles*.cc

在这种情况下,一切都很好.但是,升级到 AS 2.2 后,我无法构建任何 apk 并且总是收到以下错误:

in which case everything built fine. However, after upgrading to AS 2.2, I cannot build any apk and always recieve the following error:

任务执行失败':app:transformNative_libsWithStripDebugSymbolForDebugjava.lang.NullPointerException(无错误提示)

有谁知道这是为什么?我似乎无法找到解决方法.

Does anyone know why this is? I cannot seem to find a work around.

推荐答案

我觉得很多这些解决方案都有些过头了.很抱歉回答我自己的问题,但实际的解决方案几乎来自这里的每个帖子!

I felt like a lot of these solutions were overkill. Sorry for answering my own question, but the actual solution was taken from just about every post here!

很像@GregT 所说的,对我有用的是升级我安装的 NDK 包.而且,这样做实际上修改了 *.mk 文件,就像@Matthew_Bondarchuk 的回答一样.

Much like what @GregT said, what worked for me was upgrading the NDK package that I had installed. And, doing so actually modified the *.mk files, much like @Matthew_Bondarchuk's answer.

因此,就像@aaronvargas 所说的,这是一个错误;具体来说,Android NDK 系统没有与 Android Studio 2.2 实例化的升级一起更新.这会导致与 Android 构建工具不兼容,就像@Michael_Jess 所说的那样.

Consequently, like @aaronvargas said, this is a bug; specifically, the Android NDK system was not updated in conjunction with the upgrades that Android Studio 2.2 instanced. This causes an incompatibility with the Android build tools, much like @Michael_Jess said.

这篇关于Android Studio 2.2 原生开发迁移问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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