【问题标题】:Error:Execution failed for task 'app:generateDebugBuildConfig'错误:任务“app:generateDebugBuildConfig”执行失败
【发布时间】:2020-11-20 15:54:18
【问题描述】:

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

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

有什么解决办法..

希望能找到解决这个问题的办法

【问题讨论】:

    标签: android gradle


    【解决方案1】:

    尝试清理这对我有用的项目

    安卓版

    $ cd android 
    
    $ ./gradlew clean
    
    BUILD SUCCESSFUL in 5s
    1 actionable task: 1 executed
    

    【讨论】:

    • '.' is not recognized as an internal or external command, 在我的终端中使用 ./gradelew clean 时得到这个
    • 使用 Ctrl + Enter 从 Android Studio 终端运行命令
    【解决方案2】:

    更改端口对我有用

    你可以试试:

    react-native run-android --port=8082

    【讨论】:

      【解决方案3】:

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

      【讨论】:

        【解决方案4】:

        反应原生

        在构建 React Native 应用程序时遇到了类似的问题。在不同的端口上运行,作为默认端口 (8081) 被其他应用程序使用。

        构建应用程序的命令。

        react-native run-android --port=8082

        解决方案

        移除了额外的属性android:screenOrientation="portrait"。如果你检查日志,它会说

        行号:26;列号: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
        

        【讨论】:

          【解决方案5】:
          1. 转到项目根目录。
          2. 转到安卓文件夹。 cd android
          3. 清洁梯度。 .\gradlew clean./gradlew clean 出于某种原因对我不起作用。)
          4. 回到根目录。 cd ..
          5. 运行本机反应。 npx react-native run-android

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 2021-09-12
            • 1970-01-01
            • 1970-01-01
            • 2018-02-17
            • 2018-06-06
            相关资源
            最近更新 更多