无法运行Android,因为无法解析POM https://dl.google.com/dl/android/maven2/android/arch/lifecycle/runtime/1.1.1/runtime-1.1.1.pom

时间:2019-05-25 07:43:21

标签: react-native build.gradle maven-2

我刚刚使用react-native init -project name-下载了新项目,但是无法在模拟器中运行它(react-native run-android)

它在命令提示符下显示:

info JS server already running.
info Building and installing the app on the device (cd android && gradlew.bat app:installDebug)...

> Task :app:preDebugBuild
[Fatal Error] runtime-1.1.1.pom:2:1: Content is not allowed in prolog.
[Fatal Error] runtime-1.1.1.pom:2:1: Content is not allowed in prolog.
[Fatal Error] common-1.1.1.pom:2:1: Content is not allowed in prolog.
[Fatal Error] common-1.1.1.pom:2:1: Content is not allowed in prolog.
[Fatal Error] runtime-1.1.1.pom:2:1: Content is not allowed in prolog.
[Fatal Error] runtime-1.1.1.pom:2:1: Content is not allowed in prolog.
[Fatal Error] common-1.1.1.pom:2:1: Content is not allowed in prolog.
[Fatal Error] common-1.1.1.pom:2:1: Content is not allowed in prolog.

> Task :app:preDebugBuild FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not resolve android.arch.lifecycle:runtime:1.1.1.
  Required by:
      project :app > com.android.support:support-compat:28.0.0
   > Could not resolve android.arch.lifecycle:runtime:1.1.1.
      > Could not parse POM https://dl.google.com/dl/android/maven2/android/arch/lifecycle/runtime/1.1.1/runtime-1.1.1.pom
         > Content is not allowed in prolog.
> Could not resolve android.arch.core:runtime:1.1.1.
  Required by:
      project :app > android.arch.lifecycle:livedata:1.1.1
      project :app > android.arch.lifecycle:livedata-core:1.1.1
   > Could not resolve android.arch.core:runtime:1.1.1.
      > Could not parse POM https://dl.google.com/dl/android/maven2/android/arch/core/runtime/1.1.1/runtime-1.1.1.pom
         > Content is not allowed in prolog.
> Could not resolve android.arch.core:common:1.1.1.
  Required by:
      project :app > android.arch.lifecycle:livedata:1.1.1
      project :app > android.arch.lifecycle:livedata-core:1.1.1
   > Could not resolve android.arch.core:common:1.1.1.
      > Could not parse POM https://dl.google.com/dl/android/maven2/android/arch/core/common/1.1.1/common-1.1.1.pom
         > Content is not allowed in prolog.
> Could not resolve android.arch.lifecycle:common:1.1.1.
  Required by:
      project :app > android.arch.lifecycle:livedata-core:1.1.1
   > Could not resolve android.arch.lifecycle:common:1.1.1.
      > Could not parse POM https://dl.google.com/dl/android/maven2/android/arch/lifecycle/common/1.1.1/common-1.1.1.pom
         > Content is not allowed in prolog.

我尝试更改build:gradle版本3.0.1,这将是另一个错误,因此我认为我需要升级我的构建包或降低我的本机版本。现在,我正在尝试从android studio更新我的android sdk。

这是我当前的构建gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 16
        compileSdkVersion = 28
        targetSdkVersion = 28
        supportLibVersion = "28.0.0"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        google()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
    }
}

如果我想更新构建gradle,我会缺少什么?

0 个答案:

没有答案