16

I have already tried a lot but could not get it fix. Everything was working good before I added react-native-easy-gridview in my packages.json and then I checked out my changes after that I got this. enter image description here

Here is my build.gradle

    apply plugin: "com.android.application"
import com.android.build.OutputFile


apply from: "../../node_modules/react-native/react.gradle"


def enableSeparateBuildPerCPUArchitecture = false


def enableProguardInReleaseBuilds = false

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.pilbara_weed_management_mobile"
        minSdkVersion 16
        targetSdkVersion 22
        versionCode 8
        versionName "1.0"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
    signingConfigs {
            release {
                if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
                    storeFile file(MYAPP_RELEASE_STORE_FILE)
                    storePassword MYAPP_RELEASE_STORE_PASSWORD
                    keyAlias MYAPP_RELEASE_KEY_ALIAS
                    keyPassword MYAPP_RELEASE_KEY_PASSWORD
                }
            }
        }
    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"
            signingConfig signingConfigs.release
        }
    }
    // 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 {
    compile project(':react-native-mauron85-background-geolocation')
    compile project(':react-native-background-task')
    compile project(':react-native-keep-awake')
    compile project(':react-native-background-timer')
    compile project(':react-native-image-resizer')
    compile project(':react-native-fcm')
    compile 'com.google.firebase:firebase-core:10.0.1' //this decides your firebase SDK version
    compile project(':react-native-fetch-blob')
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile ("com.facebook.react:react-native:0.47.2") { force = true }  // From node_modules
    compile project(':react-native-smart-splashscreen')
    compile project(':react-native-fs')
    compile project(':react-native-file-opener')
    compile project(':react-native-camera')
}

// 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'
3
  • I have started receiving same and that to from today only! Commented May 15, 2018 at 8:11
  • were you able to find any solution Commented May 15, 2018 at 8:11
  • solution is at github.com/facebook/react-native/issues/19259 Commented May 15, 2018 at 9:20

2 Answers 2

16

Edit android/app/build.gradle

use this

compile ("com.facebook.react:react-native:0.44.0") { force = true }

and write version of app you use instead of 0.44.0 and delete something like this compile "com.facebook.react:react-native:+" or this compile "com.facebook.react:react-native:0.44.0"

Sign up to request clarification or add additional context in comments.

5 Comments

Thanks @mialnika. I did not work let me add something more in question.
could you provide me how your build.gradle looks like?
I removed my modules and cleared cache it worked after your solution thanks
I'm new to react native can you little explain why I needed to do that while it was working before.
This works! But it still looks like a workaround. It could bite you back when you upgrade RN version, forgetting to change this value also. Could potentially waste some hours (:
0

It cause this error for the RN 0.60. You can solve this by following,

npm i jetifier
npx jetify

fixed it for me on RN 0.60.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.