gradle 错误:执行任务“app:generateDebugBuildConfig”失败

8cdiaqws  于 2022-12-23  发布在  其他
关注(0)|答案(6)|浏览(810)

错误:执行任务"app:generateDebugBuildConfig"失败
java.io.FileNotFoundException: C:\用户\目录\桌面\Zipzap\应用程序\构建\生成\源\构建配置\调试\com\存储\我的应用程序\构建配置. java(具体访问方法是可以介绍的)
有什么办法...
我希望能找到解决这个问题的办法

w9apscun

w9apscun1#

尝试清洁项目这是为我工作
适用于android

$ cd android 

$ ./gradlew clean

BUILD SUCCESSFUL in 5s
1 actionable task: 1 executed
svmlkihl

svmlkihl2#

换个端口对我很有效
您可以尝试:
第一个月

mxg2im7a

mxg2im7a3#

尝试清理并重建项目,或者您可以尝试移除整个构建文件夹并在移除后构建。如果没有帮助,请显示您的build.gradle,您当前的信息不足以识别问题的原因。

b1uwtaje

b1uwtaje4#

    • 响应本机**

在构建react原生应用程序时遇到类似问题。在其他应用程序使用的默认端口(8081)上运行。
命令来构建应用程序。
第一个月

    • 解决方案**

删除了额外的属性android:screenOrientation="portrait"。如果您查看日志,它会显示
行号:26;列号:已经为元素"activity"指定了绑定到命名空间"http://schemas.android.com/apk/res/android"的属性"screenOrientation"。
因此删除了相同的属性。这是多次添加的

    • 错误日志**
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

x759pob2

x759pob25#

1.转到项目根目录。
1.转到android文件夹. cd android
1.清洁Gradle. .\gradlew clean./gradlew clean由于某种原因对我不起作用。)
1.返回到根目录。cd ..
1.运行响应原生. npx react-native run-android

mqkwyuun

mqkwyuun6#

在Android Studio ,
1.在菜单栏上,转到build
1.单击clean project并等待项目清理
1.然后再次在菜单栏上,转到build-〉rebuild project并等待项目重建。
1.就这样

相关问题