React-native-navigation: Failed to capture fingerprint of output files for task ':app:processDebugResources' property 'sourceOutputDir' during up-to-date check

8

Issue Description

I am getting this error when I add implementation project(':react-native-navigation') into my app\build.gradle unnder dependencies. I am following current documentation and I am not quite sure what's wrong I am doing.
Thanks i advance

Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

> Task :react-native-navigation:processReactNative57_5DebugJavaRes NO-SOURCE
> Task :react-native-navigation:transformClassesAndResourcesWithPrepareIntermediateJarsForReactNative57_5Debug
> Task :app:javaPreCompileDebug
> Task :app:mainApkListPersistenceDebug UP-TO-DATE
> Task :app:bundleDebugJsAndAssets SKIPPED
> Task :app:generateDebugResValues UP-TO-DATE
> Task :app:generateDebugResources
> Task :app:mergeDebugResources
> Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
> Task :app:processDebugManifest
> Task :app:processDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Failed to capture fingerprint of output files for task ':app:processDebugResources' property 'sourceOutputDir' during up-to-date check.
> Could not read path 'D:\react-native\rnn8\android\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\android\arch\core'.

* 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 9s
23 actionable tasks: 16 executed, 7 up-to-date
error 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
error Command failed: gradlew.bat app:installDebug

My appbuild.gradle

def enableSeparateBuildPerCPUArchitecture = false

/**
 * Run Proguard to shrink the Java bytecode in release builds.
 */
def enableProguardInReleaseBuilds = false

android {
    compileSdkVersion rootProject.ext.compileSdkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        applicationId "com.rnn8"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        missingDimensionStrategy "RNN.reactNativeVersion", "reactNative57_5"
        versionCode 1
        versionName "1.0"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    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
            matchingFallbacks = ['release', 'debug']
            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 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-navigation')
}

// 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'
}

My build.gradel


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

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

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

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

My package.json

{
  "name": "rnn8",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest",
  },
  "dependencies": {
    "react": "16.8.3",
    "react-native": "0.59.0",
    "react-native-navigation": "^2.13.1"
  },
  "devDependencies": {
    "@babel/core": "^7.3.4",
    "@babel/runtime": "^7.3.4",
    "babel-jest": "^24.5.0",
    "jest": "^24.5.0",
    "metro-react-native-babel-preset": "^0.53.0",
    "react-test-renderer": "16.8.3"
  },
  "jest": {
    "preset": "react-native"
  }
}

My settings.gradle

rootProject.name = 'rnn8'

include ':app'
include ':react-native-navigation'
project(':react-native-navigation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-navigation/lib/android/app/')

Environment

  • React Native Navigation version: ^2.13.1
  • React Native version: 0.59.0
  • React 16.8.3
  • Platform(s) (iOS, Android, or both?): Android
  • Device info (Simulator/Device? OS version? Debug/Release?): Simulator
anik587 picture anik587  ·  13 Mar 2019

Most helpful comment

138

This worked for me:

cd android
./gradlew clean
cd ..
react-native run-android

Tom-De-Backer picture Tom-De-Backer  ·  2 May 2019

All comments

0

i have faced Same issue

ShahMoiz picture ShahMoiz  ·  12 Apr 2019
0

I am facing same issue .....Please let us know what is the fix for this issue ...

sandipmali picture sandipmali  ·  21 Apr 2019
138

This worked for me:

cd android
./gradlew clean
cd ..
react-native run-android

Tom-De-Backer picture Tom-De-Backer  ·  2 May 2019
3

@TomDeBacker1 Thanks, it worked for me.

mohmdalfaha picture mohmdalfaha  ·  4 May 2019
0

i have same issue but its not worked for me

jyotijoshisupe picture jyotijoshisupe  ·  24 May 2019
2

This worked for me:

cd android
./gradlew clean
cd ..
react-native run-android

it's worked for me, so magical!
Thanks!

hu-qi picture hu-qi  ·  10 Jun 2019
3

Step 1:
Clean Project
Step 2:
Rebuild Project
Step 3:
react-native run-android
Done

rohail411 picture rohail411  ·  10 Jun 2019
0

This worked for me:

cd android
./gradlew clean
cd ..
react-native run-android

Thanks, it's worked for me

syedammar picture syedammar  ·  26 Jun 2019
0

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.

stale[bot] picture stale[bot]  ·  26 Jul 2019
0

The issue has been closed for inactivity.

stale[bot] picture stale[bot]  ·  2 Aug 2019
1

This worked for me:

cd android
./gradlew clean
cd ..
react-native run-android

Hi! This works only on debug builds for me, for release builds it keeps on giving me this error. I already tried re-installing node_modules, and have also verified my project is running AndroidX with jetifier. Do you have any suggestions on how to solve this for release builds?

joris1995 picture joris1995  ·  8 Aug 2019
0

This worked for me:

cd android
./gradlew clean
cd ..
react-native run-android

Its works !!! great....

anjalii11 picture anjalii11  ·  24 Aug 2019
0

This worked for me:

cd android
./gradlew clean
cd ..
react-native run-android

what to do for ionic 4?

gokujy picture gokujy  ·  3 Oct 2019
1

This worked for me:
cd android
./gradlew clean
cd ..
react-native run-android

what to do for ionic 4?

So, if you have an Ionic 4 project, into your project folder, go to platforms/android and run ./gradlew clean.

cd platforms/android
./gradlew clean
ionic cordova run android -l

Mayistikar picture Mayistikar  ·  16 Oct 2019
3

This worked for me:
cd android
./gradlew clean
cd ..
react-native run-android

what to do for ionic 4?

So, if you have an Ionic 4 project, into your project folder, go to platforms/android and run ./gradlew clean.

cd platforms/android
./gradlew clean
ionic cordova run android -l

./gradlew clean is not working in Ionic 4 what to do now?
and it's showing an error message like this: " What went wrong:
Failed to capture fingerprint of input files for task ':app:preDebugBuild' property 'compileManifests' during up-to-date check.

The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[17.0.0,17.0.0], [17.2.1,17.2.1]], but resolves to 17.2.1. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies."
is there any solution for this.

Giri2802 picture Giri2802  ·  30 Oct 2019
0

I'm getting the same error as @Giri2802

JMooreo picture JMooreo  ·  8 Nov 2019
0

i'm having the same issues with ionic 4 :(

Sunny41 picture Sunny41  ·  2 Dec 2019
0

This worked for me:
cd android
./gradlew clean
cd ..
react-native run-android

what to do for ionic 4?

So, if you have an Ionic 4 project, into your project folder, go to platforms/android and run ./gradlew clean.
cd platforms/android
./gradlew clean
ionic cordova run android -l

./gradlew clean is not working in Ionic 4 what to do now?
and it's showing an error message like this: " What went wrong:
Failed to capture fingerprint of input files for task ':app:preDebugBuild' property 'compileManifests' during up-to-date check.

The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[17.0.0,17.0.0], [17.2.1,17.2.1]], but resolves to 17.2.1. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies."
is there any solution for this.
cd platform cd android gradlew clean ionic cordova run android
this fixed my gradle isse but still i get

Failed to capture fingerprint of input files for task ':app:preDebugBuild' property 'compileManifests' during up-to-date check.
[cordova] > The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[17.0.0,17.0.0], [17.2.1,17.2.1]], but resolves to 17.2.1. Disable the plugin and check your dependencies tree using
./gradlew :app:dependencies.

anshcena picture anshcena  ·  29 Dec 2019