Android Studio 3.1.1 更新后,'locate' 链接不会打开生成的 APK 文件夹 [英] After Android Studio 3.1.1 update, the 'locate' link does not open generated APK folder

查看:37
本文介绍了Android Studio 3.1.1 更新后,'locate' 链接不会打开生成的 APK 文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新:问题出现在 Android 3.1.1 更新之后.

APK 生成过程完成后,Android Studio(Windows 操作系统)会建议一个弹出窗口来定位或分析 APK.

After APK generation process is completed, Android Studio (Windows OS) propose a popup to locate or analyze the APK.

不幸的是,如果我点击定位,什么也没有发生.

Unfortunately if I click on locate, nothing is happening.

更新

在 APK 生成对话框中,我指定了目标路径,即我电脑上的一个文件夹:

In the APK Generetion Dialog I specify the destination path, a folder on my pc:

在某些项目中,我使用一堆 gradle 行来重命名 APK:

And in some projects I use a bounche of gradle lines to rename the APK:

android.applicationVariants.all { variant ->
    if (variant.buildType.name == BuilderConstants.RELEASE) {
        variant.outputs.each { output ->
            def padVersionCode = variant.versionCode.toString();
            padVersionCode = padVersionCode.padLeft(5, '0')
            def newApkName = "${output.baseName}_${padVersionCode}-${variant.versionName}"
            newApkName = newApkName + ".apk"
            output.outputFile = new File(output.outputFile.parent, newApkName)
        }
    }
}

我看到 APK 已重命名并放置在预期的文件夹中,唯一的 locate 链接不起作用.

I see the APK renamed and place in th expected folder, the locate link is the only dat does not work.

推荐答案

不幸的是,如果我点击定位,什么也没有发生.

Unfortunately if I click on locate, nothing is happening.

在我看来,这像是 Android Studio 中的一个错误.

This to me looks like a bug in Android Studio.

在您的情况下,如果您看到 Android Studio 日志(帮助-> 在资源管理器中显示日志),您将看到如下内容:

In your case if you see the Android Studio logs (Help->Show Log in Explorer), you will see something like:

INFO - ide.actions.ShowFilePathAction - not a directory: T:\COMPILED_APK\release

这意味着您在 COMPILED_APK 文件夹中没有名为 release 的文件夹.

which means that you don't have a folder called called release inside COMPILED_APK folder.

所以如果你真的想要这样,那么:

So if you really want it this way then:

  1. 首先在COMPILED_APK文件夹内创建一个名为release的文件夹.

  1. First create a folder called release inside COMPILED_APK folder.

生成 apk.

现在,当您点击定位时,它会打开发布文件夹,但文件夹内什么也没有.

Now when you click on locate, it will open up the release folder but nothing will be inside the folder.

要找到您的 apk,您必须导航到 T:\COMPILED_APK\e\release

To find your apk you have to navigate to T:\COMPILED_APK\e\release

这很奇怪,但这就是它的工作原理.

This is weird, but this is how it works.

这篇关于Android Studio 3.1.1 更新后,'locate' 链接不会打开生成的 APK 文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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