After Android Studio 3.1.1 update, the 'locate' link does not open generated APK folder

我只是一个虾纸丫 提交于 2019-12-06 17:50:01

问题


UPDATE: The problem came after Android 3.1.1 update.

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.

UPDATE

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

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)
        }
    }
}

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


回答1:


Unfortunately if I click on locate, nothing is happening.

This to me looks like a bug in 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

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. First create a folder called release inside COMPILED_APK folder.

  2. Generate the apk.

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

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

This is weird, but this is how it works.



来源:https://stackoverflow.com/questions/49923569/after-android-studio-3-1-1-update-the-locate-link-does-not-open-generated-apk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!