简体   繁体   English

react native cli run android 上的任务“:app:packageDebug”执行失败

[英]Execution failed for task ':app:packageDebug' on react native cli run android

Execution failed for task ':app:packageDebug'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > java.io.IOException: Failed to read zip file 'C:\Users\PC\stuff\Project\android\app\build\outputs\apk\debug\..\..\..\..\..\release\APP-1.0.8.apk'.

For some reason I am randomly getting this error when trying to run my react native app on android via the react native CLI (react-native run-android).出于某种原因,当我尝试通过 react native CLI(react-native run-android)在 android 上运行我的 react native 应用程序时,我随机收到此错误。 What is weird is this happened randomly, everything was working fine, and I made no changes, this just randomly started happening today.奇怪的是,这是随机发生的,一切正常,我没有做任何更改,这只是今天随机发生的。 I had it running on my emulator, killed my metro server for a second, went to start everything back up via the command and started getting this error.我让它在我的模拟器上运行,杀死了我的 Metro 服务器一秒钟,然后通过命令开始备份所有内容并开始出现此错误。 I tried a few things such as deleting the build folder, running gradlew clean, and pretty much every other thing I could find online for this issue and nothing seems to work.我尝试了一些方法,例如删除构建文件夹、运行 gradlew clean 以及我可以在网上找到的几乎所有其他方法,但似乎没有任何效果。

C:\Users\PC\stuff\Project\android\app\build\outputs\apk\debug\..\..\..\..\..\release\APP-1.0.8.apk

This path does not exist after apk\debug so I am pretty sure it has to do with that but I have no idea how to fix it.此路径在 apk\debug 之后不存在,所以我很确定它与此有关,但我不知道如何修复它。 And the fact this happened randomly without me making any changes after everything working perfect has me even more confused lol.事实上,这一切都是随机发生的,而在一切工作完美之后,我没有做任何改变,这让我更加困惑,哈哈。 Has anyone ran into this that may know how to solve it?有没有人遇到过这个可能知道如何解决的问题? After a few hours of messing with it and trying everything possible that was online already I am stumped.在搞砸了几个小时并尝试了所有可能在线的东西之后,我已经被难住了。

To fix this, I had to completely delete the project folder.为了解决这个问题,我不得不完全删除项目文件夹。 Then I downloaded the project from my repo and just readded it into the folder and reinstalled all the node modules.然后我从我的 repo 中下载了这个项目,并将它读入文件夹并重新安装了所有节点模块。 That fixed it.那解决了它。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 任务':app:packageDebug'的React-Native执行失败 - React-Native Execution failed for task ':app:packageDebug' Android:任务 ':app:packageDebug' 执行失败。 > 数据 - Android: Execution failed for task ':app:packageDebug'. > data android错误:任务执行失败':app:packageDebug' - android Error:Execution failed for task ':app:packageDebug' 任务':app:packageDebug'的执行失败 - Execution failed for task ':app:packageDebug' 错误:任务':app:packageDebug'的执行失败 - Error: Execution failed for task ':app:packageDebug' Flutter:任务':app:packageDebug'的执行失败 - Flutter: Execution failed for task ':app:packageDebug' react-native run-android因错误而失败:任务执行失败':app:dexDebug' - react-native run-android failed with error: Execution failed for task ':app:dexDebug' 任务 ':app:packageDebug' 执行失败 - 无法读取 zip 文件 - Execution failed for task ':app:packageDebug' - Failed to read zip file 在反应本机 android 中构建应用程序时无法运行应用程序(错误:任务 ':app:processDebugResources' 执行失败。) - Unable to run application while build app in react native android (Error : Execution failed for task ':app:processDebugResources'.) flutter:无法运行基本的 hello world 程序,因为“任务 ':app:packageDebug' 的执行失败”。 ' - flutter: can't run a basic hello world program because ' Execution failed for task ':app:packageDebug'. '
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM