生成带签名的apk失败,并带有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)

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

问题描述

我在android studio 4上.Gradle是6.1.1.我从android studio创建了一个新的flutter项目.然后,我将该项目作为android项目打开.在工具"->颤振"中有这样的选项.这导致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.

此问题显然是由更新的 Gradle android studio gradle插件引起的.

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.

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

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