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
6条答案
按热度按时间w9apscun1#
尝试清洁项目这是为我工作
适用于android
svmlkihl2#
换个端口对我很有效
您可以尝试:
第一个月
mxg2im7a3#
尝试清理并重建项目,或者您可以尝试移除整个构建文件夹并在移除后构建。如果没有帮助,请显示您的build.gradle,您当前的信息不足以识别问题的原因。
b1uwtaje4#
在构建react原生应用程序时遇到类似问题。在其他应用程序使用的默认端口(8081)上运行。
命令来构建应用程序。
第一个月
删除了额外的属性
android:screenOrientation="portrait"
。如果您查看日志,它会显示行号:26;列号:已经为元素"activity"指定了绑定到命名空间"http://schemas.android.com/apk/res/android"的属性"screenOrientation"。
因此删除了相同的属性。这是多次添加的
x759pob25#
1.转到项目根目录。
1.转到android文件夹.
cd android
1.清洁Gradle.
.\gradlew clean
(./gradlew clean
由于某种原因对我不起作用。)1.返回到根目录。
cd ..
1.运行响应原生.
npx react-native run-android
mqkwyuun6#
在Android Studio ,
1.在菜单栏上,转到
build
1.单击
clean project
并等待项目清理1.然后再次在菜单栏上,转到
build
-〉rebuild project
并等待项目重建。1.就这样