Generate signed apk failed with build\app\intermediates\flutter\profile\libs.jar(系统找不到指定的路径) [英] Generate signed apk fails with build\app\intermediates\flutter\profile\libs.jar (The system cannot find the path specified)

查看:46
本文介绍了Generate signed apk failed with build\app\intermediates\flutter\profile\libs.jar(系统找不到指定的路径)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 android studio 4.Gradle 是 6.1.1.我从 android studio 创建了一个新的 flutter 项目.然后我将项目作为一个android项目打开.在Tools->Flutter中有这样一个选项.这导致了 gradle 同步.那是成功的.但是当我尝试用我的密钥生成签名的 apk 时.我明白了.错误

I am on android studio 4. Gradle is 6.1.1. And I created a new flutter project from android studio. Then I opened the project as an android project. There is such an option in Tools->Flutter. Which resulted in gradle sync. That was successful. But when I try to generate signed apk with my keys. I get this. error

\path\to\my\project\build\app\intermediates\flutter\profile\libs.jar (The system cannot find the path specified)

在给定位置没有配置文件目录.但是有 Debug 和 Release 目录,它们都包含 libs.jar.我搜索了所有其他网络以查找此问题.一无所获.

There is no profile directory at the given location. But there are Debug and Release directories both of which contains libs.jar. I searched all other the net for this issue. Found Nothing.

附加:我可以毫无问题地构建调试 apk.

Additional: I can build debug apk with no issues.

推荐答案

当我搜索人们在 github 上报告的有关此问题的各种问题时,我找到了解决此问题的方法.

I found a fix for this issue as I was searching through various issues people had reported on github regarding this.

这只是一种解决方法.

你可以得到两种错误.对我来说,系统找不到 profile/libs.jar,对于某些人来说,错误是 debug/libs.jar.如果问题是配置文件,您应该首先在配置文件模式下运行您的应用,然后生成签名的 apk(或在发布模式下构建和运行).要在配置文件模式下运行,请使用 flutter run --profile.Android Studio 中的Run 菜单下还有一个配置文件选项.

You can get two kinds of error. For me the system could not find profile/libs.jar, for some people the error was for debug/libs.jar. If the issue is profile, you should first run your app in profile mode and then Generate signed apk (or build and run in release mode). To run in profile mode use flutter run --profile. There is also a profile option under Run menu in Android Studio.

如果错误是关于debug/libs.jar,首先构建调试版本(以及配置文件模式),然后尝试生成签名的apk.默认情况下,flutter run 编译为调试模式.

If the error is about debug/libs.jar, first build the debug version (and also the profile mode) and then try to Generate signed apk. By default, flutter run compiles to debug mode.

这个问题显然是由更新的Gradleandroid studio gradle plugin引起的.

This issue evidently arises from the updated Gradle and android studio gradle plugin.

这是 Jwiggiff 在 github 上的解决方法页面.

Here is the workaround by Jwiggiff on the github page.

这篇关于Generate signed apk failed with build\app\intermediates\flutter\profile\libs.jar(系统找不到指定的路径)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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