Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 如何修复:React本机android/Gradle构建失败_Node.js_Android Studio_React Native_Gradle_React Native Android - Fatal编程技术网

Node.js 如何修复:React本机android/Gradle构建失败

Node.js 如何修复:React本机android/Gradle构建失败,node.js,android-studio,react-native,gradle,react-native-android,Node.js,Android Studio,React Native,Gradle,React Native Android,我正在使用谷歌地图进行一个react native(android)项目,它在几周前还在工作,但现在已经停止工作了。Gradle守护进程启动,但构建失败 我在其他帖子上尝试了推荐的解决方案,但都不起作用 android.useAndroidX=true android.enableJetifier=false 梯度5.0 建造时间:2018-11-26 11:48:43 UTC 修订:7fc6e5abf2fc5fe0824aec8a0f5462664dbcd987 Kotlin DSL:1.

我正在使用谷歌地图进行一个react native(android)项目,它在几周前还在工作,但现在已经停止工作了。Gradle守护进程启动,但构建失败

我在其他帖子上尝试了推荐的解决方案,但都不起作用

android.useAndroidX=true
android.enableJetifier=false

梯度5.0 建造时间:2018-11-26 11:48:43 UTC 修订:7fc6e5abf2fc5fe0824aec8a0f5462664dbcd987

Kotlin DSL:1.0.4 科特林:1.3.10 Groovy:2.5.4 Ant:ApacheAnt(TM)版本1.9.13于2018年7月10日编译 JVM:1.8.0_191(Oracle公司25.191-b12) 操作系统:Linux 4.15.0-50-generic amd64


AndroidManifest.xml
格拉德尔酒店 项目正在编译,但已停止工作,我在终端中收到以下错误

WARNING: The specified Android SDK Build Tools version (26.0.2) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.4.1.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '26.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Task :app:checkDebugDuplicateClasses FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> 1 exception was raised by workers:
  java.lang.RuntimeException: java.lang.RuntimeException: Duplicate class android.support.v4.app.INotificationSideChannel found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
  Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
  Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
  Duplicate class android.support.v4.graphics.drawable.IconCompatParcelizer found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
  Duplicate class android.support.v4.os.IResultReceiver found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
  Duplicate class android.support.v4.os.IResultReceiver$Stub found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
  Duplicate class android.support.v4.os.IResultReceiver$Stub$Proxy found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
  Duplicate class android.support.v4.os.ResultReceiver found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
  Duplicate class android.support.v4.os.ResultReceiver$1 found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
  Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
  Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
  Duplicate class androidx.core.graphics.drawable.IconCompatParcelizer found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
  Duplicate class androidx.core.internal.package-info found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
  Duplicate class androidx.versionedparcelable.CustomVersionedParcelable found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
  Duplicate class androidx.versionedparcelable.NonParcelField found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
  Duplicate class androidx.versionedparcelable.ParcelField found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
  Duplicate class androidx.versionedparcelable.ParcelImpl found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
  Duplicate class androidx.versionedparcelable.ParcelImpl$1 found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
  Duplicate class androidx.versionedparcelable.ParcelUtils found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
  Duplicate class androidx.versionedparcelable.VersionedParcel found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
  Duplicate class androidx.versionedparcelable.VersionedParcel$1 found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
  Duplicate class androidx.versionedparcelable.VersionedParcel$ParcelException found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
  Duplicate class androidx.versionedparcelable.VersionedParcelParcel found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
  Duplicate class androidx.versionedparcelable.VersionedParcelStream found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
  Duplicate class androidx.versionedparcelable.VersionedParcelStream$FieldBuffer found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
  Duplicate class androidx.versionedparcelable.VersionedParcelStream$InputBuffer found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
  Duplicate class androidx.versionedparcelable.VersionedParcelable found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
  Duplicate class androidx.versionedparcelable.VersionedParcelize found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)

你找到解决办法了吗?
android {
    compileSdkVersion rootProject.ext.compileSdkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        applicationId "com.mapstest"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 1
        versionName "1.0"
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
        }
    }
    buildTypes {
        release {
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }
    // applicationVariants are e.g. debug, release
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            // For each separate APK per architecture, set a unique version code as described here:
            // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
            def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
            }
        }
    }
}

dependencies {
    implementation project(':react-native-gesture-handler')
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
    implementation "com.facebook.react:react-native:+"  // From node_modules
    implementation(project(':react-native-maps')){
      exclude group: 'com.google.android.gms', module: 'play-services-base'
      exclude group: 'com.google.android.gms', module: 'play-services-maps'
    }
    implementation 'com.google.android.gms:play-services-base:17.0.0'
    implementation 'com.google.android.gms:play-services-maps:17.0.0'
}
org.gradle.jvmargs=-Xmx1536m 

VERSION_CODE=4
VERSION_NAME=0.24.2
GROUP=com.airbnb.android

POM_DESCRIPTION=React Native Map view component for Android
POM_URL=https://github.com/airbnb/react-native-maps/tree/new-scv
POM_SCM_URL=https://github.com/airbnb/react-native-maps/tree/new-scv
POM_SCM_CONNECTION=scm:git@github.com:airbnb/react-native-maps.git
POM_SCM_DEV_CONNECTION=scm:git@github.com:airbnb/react-native-maps.git
POM_LICENSE_NAME=MIT
POM_LICENSE_URL=https://github.com/airbnb/react-native-maps/blob/master/LICENSE
POM_LICENSE_DIST=repo
POM_DEVELOPER_ID=airbnb
POM_DEVELOPER_NAME=Leland Richardson

POM_NAME=ReactNative Maps library
POM_ARTIFACT_ID=react-native-maps
POM_PACKAGING=aar

android.useAndroidX=true
android.enableJetifier=false
WARNING: The specified Android SDK Build Tools version (26.0.2) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.4.1.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '26.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Task :app:checkDebugDuplicateClasses FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> 1 exception was raised by workers:
  java.lang.RuntimeException: java.lang.RuntimeException: Duplicate class android.support.v4.app.INotificationSideChannel found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
  Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
  Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
  Duplicate class android.support.v4.graphics.drawable.IconCompatParcelizer found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
  Duplicate class android.support.v4.os.IResultReceiver found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
  Duplicate class android.support.v4.os.IResultReceiver$Stub found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
  Duplicate class android.support.v4.os.IResultReceiver$Stub$Proxy found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
  Duplicate class android.support.v4.os.ResultReceiver found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
  Duplicate class android.support.v4.os.ResultReceiver$1 found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
  Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
  Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
  Duplicate class androidx.core.graphics.drawable.IconCompatParcelizer found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
  Duplicate class androidx.core.internal.package-info found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:28.0.0)
  Duplicate class androidx.versionedparcelable.CustomVersionedParcelable found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
  Duplicate class androidx.versionedparcelable.NonParcelField found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
  Duplicate class androidx.versionedparcelable.ParcelField found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
  Duplicate class androidx.versionedparcelable.ParcelImpl found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
  Duplicate class androidx.versionedparcelable.ParcelImpl$1 found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
  Duplicate class androidx.versionedparcelable.ParcelUtils found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
  Duplicate class androidx.versionedparcelable.VersionedParcel found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
  Duplicate class androidx.versionedparcelable.VersionedParcel$1 found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
  Duplicate class androidx.versionedparcelable.VersionedParcel$ParcelException found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
  Duplicate class androidx.versionedparcelable.VersionedParcelParcel found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
  Duplicate class androidx.versionedparcelable.VersionedParcelStream found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
  Duplicate class androidx.versionedparcelable.VersionedParcelStream$FieldBuffer found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
  Duplicate class androidx.versionedparcelable.VersionedParcelStream$InputBuffer found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
  Duplicate class androidx.versionedparcelable.VersionedParcelable found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)
  Duplicate class androidx.versionedparcelable.VersionedParcelize found in modules classes.jar (androidx.versionedparcelable:versionedparcelable:1.0.0) and classes.jar (com.android.support:versionedparcelable:28.0.0)