问题标签 [android-studio-2.2]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
352 浏览

android - android studio 2.2 预览版应用程序无法识别库依赖项

我有一个带有库项目的项目,库项目中的第三个依赖项:

库构建.gradle

应用程序构建.gradle

现在我遇到了一个问题,我不能在库中使用依赖类。它无法识别这些库。

在此处输入图像描述

但是当我将依赖项放入应用程序 build.grandle 时。这个问题消失了。那么有人可以帮助我吗?有什么问题。

谢谢!

0 投票
1 回答
758 浏览

android-studio - Android Studio 2.2 预览 2/3/4/5 缺少布局检查器左右细节窗格

我最近升级了 Android Studio 2.2 preview 2,但不知何故,布局检查器的左右细节窗格(在下方圈出)丢失了。我怎样才能让它们再次出现?它是Android Studio的错误吗?

在此处输入图像描述

打开.li文件时的工具窗口快照:

在此处输入图像描述

更新 20160609:

Android Studio 2.2 preview 3 仍然有这个问题。

更新 20160705:

Android Studio 2.2 preview 4 仍然有这个问题。

更新 20160715:

Android Studio 2.2 preview 5 仍然有这个问题。正如下面一位成员所报告的那样。

0 投票
10 回答
21614 浏览

firebase - 无法从 Android Studio 助手连接到 Firebase

我正在尝试从 Android Studio 协助连接到 Firebase,但尽管有互联网连接,但仍出现以下错误。

在此处输入图像描述

0 投票
8 回答
68230 浏览

android - 警告:不要将 Android 上下文类放在静态字段中;这是内存泄漏(也破坏了即时运行)

安卓工作室:

不要将 Android 上下文类放在静态字段中;这是内存泄漏(也破坏了即时运行)

所以 2 个问题:

#1 如何在startService没有上下文的静态变量的情况下从静态方法调用 a?
#2 如何从静态方法(相同)发送 localBroadcast?

例子:

或者

不使用的正确方法是什么mContext

注意:我认为我的主要问题可能是如何将上下文传递给调用方法所在的类。

0 投票
1 回答
66 浏览

android - 如何修复 Android Studio 2.2 无法识别 jar?

我最近从 Studio 2.1 升级到 2.2,并且在一个项目中我有一些库依赖项,并带来了旧的:

在 Studio 2.1 中,所有的 jar 都可以完美运行。但出于某种原因,在 2.2 中,IDE 似乎无法识别其中一个 jar - 它旁边没有扩展三角形,并且其中的类不可访问。构建项目工作得很好,所以 gradle 文件显然是正确的。但 Studio 2.2 就是无法识别它。

没有明显的错误。我已经尝试使用 gradle、clean 构建等反复重新同步配置,但似乎没有任何效果。我能想到的唯一可能导致它的原因是 JAR 非常大(2.6MB),但增加内存大小似乎没有帮助。

有没有人遇到过这个问题,或者有任何修复它的建议?

0 投票
0 回答
1082 浏览

android - Android Studio 2.2 cmake 错误 (c++)

有没有人尝试在新的 Android Studio 2.2 预览版 3 中使用 CMake?

我在一个支持 C++ 的简单“Hello world”项目中遇到了这个错误:

0 投票
1 回答
7344 浏览

android - 如何安装 Android Studio 2.2 CMake 包/工具?

我最近安装的 Android Studio 2.2 preview 3 似乎找不到 CMake。

我尝试从 SDK Tools 安装它,但没有这样的包...

在此处输入图像描述

0 投票
1 回答
745 浏览

android - 错误的构建变体

我的应用程序中有 2 个模块,一个用于 API,一个用于应用程序。在 API 模块中,我定义了 2 个 API 端点,具体取决于 API 是否以debugrelease模式编译:

在 Android Studio 的Build variant面板中,我为应用程序和 API 模块选择了调试变体。但是,当我手动按下 play/clean/rebuild/remove all build directory/resync gradle 时,无论我做什么都是每次都会编译的发布 API。

有什么提示吗?

尝试使用 gradle 构建工具2.1.02.2.0-aplha3.

0 投票
2 回答
984 浏览

android - Android Studio release build not zipaligning

I'm having trouble uploading my .apk to Google Play Store. I've previously been able to upload multiple different builds up to last week, but today I get the error that I should zipalign my file first.

EDIT: Normally, I was able to generate signed and zipaligned .apk's that the AppStore accepted by just using Android Studios built-in "Generate Signed APK" wizard. This did not work today, and led to the following:

I've tried the following:

  • Manual zipalign of the app-release.apk generated by Android studio. When I try this, I get the error "VERIFICATION FAILED" at the end. Some googling says that providing full path to a location where you have write-access is important, so I've tried doing it with the specific path, but to no avail:

    ./zipalign -v -f 4 /Users/<username>/git/<projectname>/app/app-release.apk /Users/<username>/git/<projectname>/app/aligned.apk

  • I then tried to download the APK Signer 1.8.5 and use that to zipalign the .apk - and behold, success! It creates an aligned apk, and i'm able to verify it using both Android Studio's own zipalign tool by

    ./zipalign -c -v 4 app-release_ALIGNED.apk

    and the APK Signer itself. However, when uploading I now get the error:

    Failed to run aapt dump badging: W/ResourceType(208730): Bad resource table: header size 0x80a3 or total size 0x80b50000 is larger than data size 0x7bcc4 ERROR: dump failed because the resource table is invalid/corrupt.

    This, I haven't been able to find solutions for.

  • I then tried to recreate the circumstances I was previously able to upload APKs from by reverting to a previous commit/build, as well as reverting from AS 2.2 preview 3 to AS2.2 preview 2, but again - no luck.

  • Finally, I tried explicitly adding

    zipAlignEnabled true

    to my release config in Gradle, but that didn't help either.

I'm out of suggestions, and hoping someone can help? :-) Thanks

0 投票
1 回答
1027 浏览

linux - Linux - Gradle 无法删除临时文件并且构建失败

当我执行$ gradle :android:clean$ gradle :android:assembleDebug得到

我想提一下,该项目位于 NTFS 分区上。

我找到了一种解决方法,我正在使用--continue选项来忽略构建失败。但我想知道为什么无法删除该文件。是不是被什么东西挡住了?