【问题标题】:Gradle Build issue while trying to run a react-native project using run-android command尝试使用 run-android 命令运行 react-native 项目时出现 Gradle Build 问题
【发布时间】:2020-08-04 02:48:32
【问题描述】:

在尝试执行 react-native run-android 命令以在 Android Studio 模拟器上运行我的 react-native 项目时,我遇到了这个构建 gradle 问题。有人可以建议任何必要的更改吗?

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'newzera'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve org.glassfish.jaxb:jaxb-runtime:2.2.11.
     Required by:
         project : > com.android.tools.build:gradle:3.4.2 > com.android.tools.build:builder:3.4.2 > com.android.tools:sdklib:26.4.2 > com.android.tools:repository:26.4.2
      > Could not resolve org.glassfish.jaxb:jaxb-runtime:2.2.11.
         > Could not parse POM https://jcenter.bintray.com/org/glassfish/jaxb/jaxb-runtime/2.2.11/jaxb-runtime-2.2.11.pom
            > Could not resolve com.sun.xml.bind.mvn:jaxb-runtime-parent:2.2.11.
               > Could not resolve com.sun.xml.bind.mvn:jaxb-runtime-parent:2.2.11.
                  > Could not parse POM https://jcenter.bintray.com/com/sun/xml/bind/mvn/jaxb-runtime-parent/2.2.11/jaxb-runtime-parent-2.2.11.pom
                     > Could not resolve com.sun.xml.bind.mvn:jaxb-parent:2.2.11.
                        > Could not resolve com.sun.xml.bind.mvn:jaxb-parent:2.2.11.
                           > Could not parse POM https://jcenter.bintray.com/com/sun/xml/bind/mvn/jaxb-parent/2.2.11/jaxb-parent-2.2.11.pom
                              > Could not resolve com.sun.xml.bind:jaxb-bom-ext:2.2.11.
                                 > Could not resolve com.sun.xml.bind:jaxb-bom-ext:2.2.11.
                                    > Could not parse POM https://jcenter.bintray.com/com/sun/xml/bind/jaxb-bom-ext/2.2.11/jaxb-bom-ext-2.2.11.pom
                                       > Invalid byte 2 of 4-byte UTF-8 sequence.

* 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 12s

【问题讨论】:

    标签: android react-native android-studio build.gradle


    【解决方案1】:

    看起来以下插件在您的 gradle 构建中导致错误:

    org.glassfish.jaxb:jaxb-runtime:2.2.11.
    

    也许你应用了错误的 gradle 插件。我建议阅读建议您应用此插件的文档。

    【讨论】:

    • 我没有应用任何这样的插件。实际上,我正在尝试运行官方网站上提供的示例 react-native 项目。有什么办法可以去掉这个插件?
    猜你喜欢
    • 2020-01-23
    • 1970-01-01
    • 1970-01-01
    • 2020-07-27
    • 2021-10-14
    • 1970-01-01
    • 2022-10-02
    • 2020-01-09
    • 1970-01-01
    相关资源
    最近更新 更多