简体   繁体   English

错误:任务 'app:generateDebugBuildConfig' 执行失败

[英]Error:Execution failed for task 'app:generateDebugBuildConfig'

Error:Execution failed for task 'app:generateDebugBuildConfig'错误:任务 'app:generateDebugBuildConfig' 执行失败

java.io.FileNotFoundException: C:\Users\bok\Desktop\Zipzap\app\build\generated\source\buildConfig\debug\com\storie\myapp \BuildConfig.java (Le chemin d'accès spécifié est introuvable) java.io.FileNotFoundException: C:\Users\bok\Desktop\Zipzap\app\build\generated\source\buildConfig\debug\com\storie\myapp\BuildConfig.java(Le chemin d'accès spécifié est introuvable)

What's the solution..有什么办法..

I hope to find a solution to this problem我希望找到解决这个问题的办法

Try to clean project this is working for me尝试清理这对我有用的项目

for android安卓版

$ cd android 

$ ./gradlew clean

BUILD SUCCESSFUL in 5s
1 actionable task: 1 executed

Try to clean and rebuild project or you can try to remove whole build folder and build after removing.尝试清理并重建项目,或者您可以尝试删除整个构建文件夹并在删除后构建。 If it won't help, show your build.gradle, your current information isn't enough to recognise the reason of problem.如果它没有帮助,请显示您的 build.gradle,您当前的信息不足以识别问题的原因。

Changing port worked for me更改端口对我有用

You Could try:你可以试试:

react-native run-android --port=8082

React Native反应本机

Faced similar issue while building react native app.在构建 React Native 应用程序时遇到了类似的问题。 Running on the different port as the default port (8081) is used by some other app.在不同的端口上运行,因为其他应用程序使用默认端口 (8081)。

Command to build the app.构建应用程序的命令。

react-native run-android --port=8082

Solution解决方案

Removed extra attribute android:screenOrientation="portrait" .删除了额外的属性android:screenOrientation="portrait" If you check the log, it says如果您检查日志,它会说

lineNumber: 26;行号:26; columnNumber: 56;列数:56; Attribute "screenOrientation" bound to namespace " http://schemas.android.com/apk/res/android " was already specified for element "activity".已为元素“activity”指定了绑定到命名空间“ http://schemas.android.com/apk/res/android ”的属性“screenOrientation”。

hence removed the same attribute.因此删除了相同的属性。 This was being added multiple times这被多次添加

Error log错误日志

Configure project :react-native-webview
:react-native-webview:reactNativeAndroidRoot /Users/PROJECT_PATH/node_modules/react-native/android

Task :app:generateDebugBuildConfig FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:generateDebugBuildConfig'.
org.xml.sax.SAXParseException; systemId: file:/Users/PROJECT_PATH/android/app/src/main/AndroidManifest.xml; lineNumber: 26; columnNumber: 56; Attribute "screenOrientation" bound to namespace "http://schemas.android.com/apk/res/android" was already specified for element "activity".

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
32 actionable tasks: 1 executed, 31 up-to-date
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html

Command failed: ./gradlew installDebug

错误截图

  1. Go to project root.转到项目根目录。
  2. Go to android folder.转到android文件夹。 cd android
  3. Clean gradle.干净的渐变。 .\\gradlew clean ( ./gradlew clean didnot work for me for some reason.) .\\gradlew clean./gradlew clean由于某种原因对我不起作用。)
  4. Go back to root.回到root。 cd ..
  5. Run react native.运行本机反应。 npx react-native run-android

In android studio,在安卓工作室,

  1. On the Menu Bar, go to build在菜单栏上,转到build
  2. Click clean project and wait for project to clean单击clean project并等待项目清理
  3. Then on the menu bar again, go to build -> rebuild project and wait for project to rebuild.然后再次在菜单栏上,转到build -> rebuild project并等待项目重建。
  4. That's all就这样

暂无
暂无

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

相关问题 任务 ':app:generateDebugBuildConfig 执行失败 - Execution failed for task ':app:generateDebugBuildConfig 任务 ':app:generateDebugBuildConfig' Flutter 执行失败 - Execution failed for task ':app:generateDebugBuildConfig' Flutter 任务“:app:generateDebugBuildConfig”执行失败。 扑腾 - Execution failed for task ':app:generateDebugBuildConfig'. in flutter 在 Android Studio 中运行 Flutter 应用程序时出错:任务 ':app:generateDebugBuildConfig' 执行失败 - ERROR When Running Flutter App in Android Studio: Execution failed for task ':app:generateDebugBuildConfig' Flutter 错误:任务“:app:generateDebugBuildConfig”执行失败。 (/android/app/src/main/AndroidManifest.xml 中的问题) - Flutter error : Execution failed for task ':app:generateDebugBuildConfig'. (problem in /android/app/src/main/AndroidManifest.xml ) 我遇到了什么问题:任务':app:generateDebugBuildConfig'的执行失败。 > \\ AndroidManifest.xml中 - I am getting What went wrong: Execution failed for task ':app:generateDebugBuildConfig'. >\AndroidManifest.xml 构建 React Native 应用程序失败:任务 :app:generateDebugBuildConfig FAILED - Building React Native app fails: Task :app:generateDebugBuildConfig FAILED 错误:任务':app:transformClassesWithJarMergingForDebug'的执行失败。 >错误 - Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. > error 错误:任务“:app:transformClassesWithMultidexlistForDebug”的执行失败 - Error:Execution failed for task ':app:transformClassesWithMultidexlistForDebug' 错误:运行时任务 ':app:dexDebug' 执行失败 - Error:Execution failed for task ':app:dexDebug' at runtime
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM