evollu / react-native-fcm

react native module for firebase cloud messaging and local notification
MIT License
1.73k stars 679 forks source link

Failed to capture snapshot of input files for task ':app:checkDebugClasspath' property 'runtimeClasspath' during up-to-date check #1098

Open ArronJLinton opened 5 years ago

ArronJLinton commented 5 years ago

I'm running react-native run-android and it keeps failing during the build. I'm using the latest version of android studio and I believe everything is in order regarding firebase imports (referencing "Add Firebase To your Android App Docs and React-native-fcm) as I'm using firebase services. However, I keep running into this error below and it seems to have something to do with how importing google services and such.

Extended Error Message

* What went wrong:
Failed to capture snapshot of input files for task ':app:checkDebugClasspath' property 'runtimeClasspath' during up-to-date check.
> The library com.google.android.gms:play-services-base is being requested by various other libraries at [[10.2.4,10.2.4]], but resolves to 16.0.1. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.api.UncheckedIOException: Failed to capture snapshot of input files for task ':app:checkDebugClasspath' property 'runtimeClasspath' during up-to-date check.
        at org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository.snapshotTaskFiles(CacheBackedTaskHistoryRepository.java:331)
        at org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository.createExecution(CacheBackedTaskHistoryRepository.java:151)

build.gradle

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

buildscript {
    ext {
        buildToolsVersion = "28.0.2"
        minSdkVersion = 16
        compileSdkVersion = 28
        targetSdkVersion = 27
        supportLibVersion = "28.0.0"
    }
    repositories {

        jcenter()
        google()
        // mavenLocal()
        // mavenCentral()
        // maven {
        //     url 'https://maven.fabric.io/public'
        //     name 'Google'
        // }
        // maven { url 'https://dl.bintray.com/android/android-tools' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:4.0.2'
        // classpath 'io.fabric.tools:gradle:1.26.1'
        // classpath 'com.google.firebase:firebase-plugins:1.1.5'
    }
}

allprojects {
    repositories {
        google()
        jcenter { url "http://jcenter.bintray.com/"}           
    }
}

app/build.gradle

android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion

    defaultConfig {
        applicationId "com.jast"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionName "1.0"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }

    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86"
        }
    }
    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]
            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-vector-icons')
    implementation project(':react-native-maps')
    implementation project(':react-native-mail')
    implementation project(':react-native-linear-gradient')
    implementation project(':react-native-image-picker')
    implementation project(':react-native-firebase')
    implementation project(':react-native-fetch-blob')
    implementation project(':react-native-fcm')
    implementation project(':react-native-aws')
    implementation project(':react-native-vector-icons')
    implementation project(':react-native-maps')
    implementation project(':react-native-mail')
    implementation project(':react-native-linear-gradient')
    implementation project(':react-native-image-picker')
    implementation project(':react-native-firebase')
    implementation project(':react-native-fetch-blob')
    implementation project(':react-native-fcm')
    implementation project(':react-native-aws')
    implementation project(':react-native-vector-icons')
    implementation project(':react-native-maps')
    implementation project(':react-native-mail')
    implementation project(':react-native-linear-gradient')
    implementation project(':react-native-image-picker')
    implementation project(':react-native-firebase')
    implementation project(':react-native-fetch-blob')
    implementation project(':react-native-fcm')
    implementation project(':react-native-aws')

    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 "com.google.android.gms:play-services-base:16.0.1"
    implementation "com.google.firebase:firebase-core:16.0.6"
    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'
    implementation "com.google.firebase:firebase-messaging:17.3.4"
    implementation "com.google.firebase:firebase-functions:16.1.3"
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}

apply plugin: 'com.google.gms.google-services'