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

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

问题描述

在切换到AS 2.2之前,我有以下结构来实现我的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并始终收到以下错误:

lockquote
$ p $ c $执行失败对于任务':app:transformNative_libsWithStripDebugSymbolForDebug
java.lang.NullPointerException(无错误消息)


有人知道这是为什么吗?我似乎无法找到解决办法。

解决方案

我觉得很多这些解决方案都是过分的。很抱歉回答我自己的问题,但实际的解决方案是从几乎每一个职位在这里!

就像@GregT说的一样,对我来说,升级我安装的NDK软件包非常有效。而且,这样做实际上修改了 *。mk 文件,就像@ Matthew_Bondarchuk的答案一样。

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

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

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

Execution failed for task':app:transformNative_libsWithStripDebugSymbolForDebug java.lang.NullPointerException (no error message)

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!

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.

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天全站免登陆