错误:任务'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èsspécifiéestintrouvable )
解决方案是什么..
我希望找到解决这个问题的方法
答案 0 :(得分:10)
尝试清理适合我的项目
对于Android
$ cd android
$ ./gradlew clean
BUILD SUCCESSFUL in 5s
1 actionable task: 1 executed
答案 1 :(得分:0)
尝试清理并重建项目,或者您可以尝试删除整个构建文件夹并在删除后构建。如果它没有帮助,请显示您的build.gradle,您当前的信息不足以识别问题的原因。
答案 2 :(得分:0)
反应原生
在构建本机应用程序时遇到类似问题。在其他端口上运行,其他应用程序使用默认端口(8081)。
用于构建应用的命令。
react-native run-android --port=8082
解决方案
已删除额外属性android:screenOrientation="portrait"
。如果您查看日志,则会显示
lineNumber:26; columnNumber:56;属性“ screenOrientation”的界限 命名空间“ http://schemas.android.com/apk/res/android”已存在 为元素“活动”指定。
因此删除了相同的属性。这已被添加多次
错误日志
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
答案 3 :(得分:0)
换港口对我有用
您可以尝试:
react-native run-android --port=8082
答案 4 :(得分:0)
cd android
.\gradlew clean
(./gradlew clean
由于某种原因对我不起作用。)cd ..
npx react-native run-android