GVKun编程网logo

React-native > Task :app:generatePackageList FAILED

3

在这篇文章中,我们将为您详细介绍React-native>Task:app:generatePackageListFAILED的内容。此外,我们还会涉及一些关于(React-Native)任务:app

在这篇文章中,我们将为您详细介绍React-native > Task :app:generatePackageList FAILED的内容。此外,我们还会涉及一些关于(React-Native) 任务 :app:generatePackageList FAILED、> 任务 :react-native-community_async-storage:checkDebugManifest FAILED in react native、Android-Studio Execution failed for task '':app:pro、Android_bug 之 task '':app:mergeDebugResources''. > Some file crunching failed, see logs f的知识,以帮助您更全面地了解这个主题。

本文目录一览:

React-native > Task :app:generatePackageList FAILED

React-native > Task :app:generatePackageList FAILED

如何解决React-native > Task :app:generatePackageList FAILED

我一直在使用 IOS 模拟器开发 RN 应用程序,现在我第一次尝试在 android 模拟器中构建应用程序,但出现此错误

enter image description here

我有安卓开发环境

任何线索是什么问题或可能的解决方案?

(React-Native) 任务 :app:generatePackageList FAILED

(React-Native) 任务 :app:generatePackageList FAILED

如何解决(React-Native) 任务 :app:generatePackageList FAILED

我想部署一个生成 APK 文件的 react-native 项目,但是当我在 android 文件夹中使用 ./gradlew assembleRelease 时,控制台显示:

任务 :app:generatePackageList 失败

FAILURE:构建失败,出现异常。

  • 哪里: 脚本 ''.\\ReactNativeProject\\ETS_Finder\\node_modules@react-native-community\\cli-platform-android\\native_modules.gradle'' 行:131
  • 出了什么问题: 任务“:app:generatePackageList”执行失败。

java.lang.IllegalArgumentException(无错误信息)`

我已经按照 React-Native 文档的建议为应用创建了一个密钥并修改了 build.gradle 文件。

我也尝试使用 Android Studio 构建相同的应用程序,但构建输出显示:Build Failed : Cause: argument type mismatch

编辑 1 我的 build.gradle :

  1. project.ext.react = [
  2. enableHermes: false,// clean and rebuild if changing
  3. ]
  4. apply from: "../../node_modules/react-native/react.gradle"
  5. /**
  6. * Set this to true to create two separate APKs instead of one:
  7. * - An APK that only works on ARM devices
  8. * - An APK that only works on x86 devices
  9. * The advantage is the size of the APK is reduced by about 4MB.
  10. * Upload all the APKs to the Play Store and people will download
  11. * the correct one based on the cpu architecture of their device.
  12. */
  13. def enableSeparateBuildPercpuArchitecture = false
  14. /**
  15. * Run Proguard to shrink the Java bytecode in release builds.
  16. */
  17. def enableProguardInReleaseBuilds = false
  18. /**
  19. * The preferred build flavor of JavaScriptCore.
  20. *
  21. * For example,to use the international variant,you can use:
  22. * `def jscFlavor = ''org.webkit:android-jsc-intl:+''`
  23. *
  24. * The international variant includes ICU i18n library and necessary data
  25. * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
  26. * give correct results when using with locales other than en-US. Note that
  27. * this variant is about 6MiB larger per architecture than default.
  28. */
  29. def jscFlavor = ''org.webkit:android-jsc:+''
  30. /**
  31. * Whether to enable the Hermes VM.
  32. *
  33. * This should be set on project.ext.react and mirrored here. If it is not set
  34. * on project.ext.react,JavaScript will not be compiled to Hermes Bytecode
  35. * and the benefits of using Hermes will therefore be sharply reduced.
  36. */
  37. def enableHermes = project.ext.react.get("enableHermes",false);
  38. android {
  39. ndkVersion rootProject.ext.ndkVersion
  40. compileSdkVersion rootProject.ext.compileSdkVersion
  41. compileOptions {
  42. sourceCompatibility JavaVersion.VERSION_1_8
  43. targetCompatibility JavaVersion.VERSION_1_8
  44. }
  45. defaultConfig {
  46. applicationId "com.ets_finder"
  47. minSdkVersion rootProject.ext.minSdkVersion
  48. targetSdkVersion rootProject.ext.targetSdkVersion
  49. versionCode 1
  50. versionName "1.0"
  51. }
  52. signingConfigs {
  53. release {
  54. storeFile file(''your_key_name.keystore'')
  55. storePassword ''your_key_store_password''
  56. keyAlias ''your_key_alias''
  57. keyPassword ''your_key_file_alias_password''
  58. }
  59. }
  60. splits {
  61. abi {
  62. reset()
  63. enable enableSeparateBuildPercpuArchitecture
  64. universalApk false // If true,also generate a universal APK
  65. include "armeabi-v7a","x86","arm64-v8a","x86_64"
  66. }
  67. }
  68. signingConfigs {
  69. debug {
  70. storeFile file(''debug.keystore'')
  71. storePassword ''android''
  72. keyAlias ''androiddebugkey''
  73. keyPassword ''android''
  74. }
  75. }
  76. buildTypes {
  77. debug {
  78. signingConfig signingConfigs.debug
  79. }
  80. release {
  81. // Caution! In production,you need to generate your own keystore file.
  82. // see https://reactnative.dev/docs/signed-apk-android.
  83. signingConfig signingConfigs.debug
  84. minifyEnabled enableProguardInReleaseBuilds
  85. proguardFiles getDefaultProguardFile("proguard-android.txt"),"proguard-rules.pro"
  86. signingConfig signingConfigs.release
  87. }
  88. }
  89. // applicationVariants are e.g. debug,release
  90. applicationVariants.all { variant ->
  91. variant.outputs.each { output ->
  92. // For each separate APK per architecture,set a unique version code as described here:
  93. // https://developer.android.com/studio/build/configure-apk-splits.html
  94. // Example: versionCode 1 will generate 1001 for armeabi-v7a,1002 for x86,etc.
  95. def versionCodes = ["armeabi-v7a": 1,"x86": 2,"arm64-v8a": 3,"x86_64": 4]
  96. def abi = output.getFilter(OutputFile.ABI)
  97. if (abi != null) { // null for the universal-debug,universal-release variants
  98. output.versionCodeOverride =
  99. defaultConfig.versionCode * 1000 + versionCodes.get(abi)
  100. }
  101. }
  102. }
  103. }
  104. dependencies {
  105. implementation filetree(dir: "libs",include: ["*.jar"])
  106. //noinspection GradleDynamicVersion
  107. implementation "com.facebook.react:react-native:+" // From node_modules
  108. implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
  109. debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
  110. exclude group:''com.facebook.fbjni''
  111. }
  112. debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
  113. exclude group:''com.facebook.flipper''
  114. exclude group:''com.squareup.okhttp3'',module:''okhttp''
  115. }
  116. debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
  117. exclude group:''com.facebook.flipper''
  118. }
  119. if (enableHermes) {
  120. def hermesPath = "../../node_modules/hermes-engine/android/";
  121. debugImplementation files(hermesPath + "hermes-debug.aar")
  122. releaseImplementation files(hermesPath + "hermes-release.aar")
  123. } else {
  124. implementation jscFlavor
  125. }
  126. }
  127. // Run this once to be able to run the application with BUCK
  128. // puts all compile dependencies into folder libs for BUCK to use
  129. task copyDownloadableDepsToLibs(type: copy) {
  130. from configurations.compile
  131. into ''libs''
  132. }
  133. apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

本机反应:"version": "0.64.2"

解决方法

我在这篇文章中找到了解决方案:

https://stackoverflow.com/questions/67093053/react-native-execution-failed-for-task-appgeneratepackagelist

它说 react-native-cli 不支持 Gradle ver 7.0,所以需要将 Gradle 降级到以前的版本(例如我使用 Gradle ver. 6.6)

,

我遇到了同样的错误,降级到 Gradle 6.9 工作正常!

> 任务 :react-native-community_async-storage:checkDebugManifest FAILED in react native

> 任务 :react-native-community_async-storage:checkDebugManifest FAILED in react native

如何解决> 任务 :react-native-community_async-storage:checkDebugManifest FAILED in react native

我在构建 React Native 应用程序时遇到错误。

错误:> Task :react-native-community_async-storage:checkDebugManifest Failed

2 actionable tasks: 2 executed

FAILURE: Build Failed with an exception.

* What went wrong:
Execution Failed for task '':react-native-community_async-storage:checkDebugManifest''.
> Couldn''t delete stale output file

我将 gradle 6.3 更改为 6.5,我认为这可以解决问题,但事实并非如此。我不知道如何修复这个错误。

Android-Studio Execution failed for task '':app:pro

Android-Studio Execution failed for task '':app:pro

(适合于1.0版本)当出现图中右下角的问题时,可以按照文章的提示进行修改,就能正常运行了。

第一步打开build.gradle(Module.app)文件。

第二步找到图中2表示的代码,然后删除。

第三步保存即可。

Android_bug 之 task '':app:mergeDebugResources''. > Some file crunching failed, see logs f

Android_bug 之 task '':app:mergeDebugResources''. > Some file crunching failed, see logs f

错误代码

Error:Execution failed for task '':PulltorefreshLibrary:mergeDebugAndroidTestResources''.

> Some file crunching failed, see logs for details
AAPT err(Facade for 598446055) : No Delegate set : lost message:libpng error: CgBI: unhandled critical chunk

Gradle: Execution failed for task '':processDebugManifest''

 

错误原因

PulltorefreshLibrary res 下的图片有问题

1. 图片损坏打不开或格式错误直接把.jpg 重命名.png 文件 只改变了扩展名而格式没有得到改变 需要用转换软件进行转换

2. 据说图片经过 xcode4 压缩后会出现该情况 如果情况属实 经过其他压缩软件压缩后是否会出现该问题 (没经过证实)

关于React-native > Task :app:generatePackageList FAILED的介绍现已完结,谢谢您的耐心阅读,如果想了解更多关于(React-Native) 任务 :app:generatePackageList FAILED、> 任务 :react-native-community_async-storage:checkDebugManifest FAILED in react native、Android-Studio Execution failed for task '':app:pro、Android_bug 之 task '':app:mergeDebugResources''. > Some file crunching failed, see logs f的相关知识,请在本站寻找。

本文标签: