[英]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
cd android
.\\gradlew clean
( ./gradlew clean
didnot work for me for some reason.) .\\gradlew clean
( ./gradlew clean
由于某种原因对我不起作用。)cd ..
npx react-native run-android
In android studio,在安卓工作室,
build
build
clean project
and wait for project to cleanclean project
并等待项目清理build
-> rebuild project
and wait for project to rebuild.build
-> rebuild project
并等待项目重建。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.