React-native: Could not get unknow property 'mergeResourcesProvider' when I run my app on android

Created on 19 Mar 2019  路  11Comments  路  Source: facebook/react-native

I am getting this error when I run the app on Android

  • Where:
    Script 'C:\reactnative\authnode_modules\react-native\react.gradle' line: 95
  • What went wrong:
    A problem occurred configuring project ':app'.
    > Could not get unknown property 'mergeResourcesProvider' for object of type com.android.build.gradle.internal.api.ApplicationVariantImpl.

Environment

System:
OS: Windows 10
CPU: (4) x64 Intel(R) Core(TM) i7-4600U CPU @ 2.10GHz
Memory: 6.96 GB / 15.91 GB
Binaries:
Yarn: 1.13.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 3.3.0.0 AI-182.5107.16.33.5314842

Bug Android Locked

Most helpful comment

the same problem when updating to v0.59.1, I could solve it by updating gradle and the compilation version to 28.

in /android/build.gradle

buildscript {
ext {
minSdkVersion = 21
compileSdkVersion = 28
targetSdkVersion = 26
supportLibVersion = "28.0.0"
playServicesVersion = "15.0.1"
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
}
}

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"
}
maven {
url 'https://maven.google.com'
}
}
configurations.all {
resolutionStrategy.force "com.android.support:support-v4:${rootProject.ext.supportLibVersion}"
}
}

in /android/gradle/wrapper/gradle-wrapper.properties

distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip

All 11 comments

Can you run react-native info and edit your issue to include these results under the Environment section?

If you believe this information is irrelevant to the reported issue, you may write [skip envinfo] alongside an explanation in your Environment: section.

I am also facing the same issue
React Native Environment Info:
System:
OS: Windows 10
CPU: (4) x64 Intel(R) Core(TM) i3-6100U CPU @ 2.30GHz
Memory: 593.94 MB / 3.89 GB
Binaries:
Yarn: 1.12.3 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 3.2.0.0 AI-181.5540.7.32.5056338

I am also facing the same issue
React Native Environment Info:
System:
OS: Windows 10
CPU: (4) x64 Intel(R) Core(TM) i3-6100U CPU @ 2.30GHz
Memory: 593.94 MB / 3.89 GB
Binaries:
Yarn: 1.12.3 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 3.2.0.0 AI-181.5540.7.32.5056338

I just re-did the whole project, fortunately, I was just beginning to code the app.

I just re-did the whole project, fortunately, I was just beginning to code the app.
Although I would still like to find a solution

Same problem from RN upgrade(Android)
v0.58.6 -> v0.59.1
React Native Environment Info:

    System:
      OS: macOS 10.14.1
      CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
      Memory: 18.05 MB / 8.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.0.0 - /usr/local/bin/node
      Yarn: 1.12.3 - /usr/local/bin/yarn
      npm: 6.8.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    IDEs:
      Android Studio: 1.5 AI-141.2836215
      Xcode: /undefined - /usr/bin/xcodebuild
    npmPackages:
      react: ^16.6.3 => 16.8.4
      react-native: ~0.59.1 => 0.59.1
    npmGlobalPackages:
      react-native-cli: 2.0.1

I faced with the same problem and this workaround works for me.
https://github.com/wix/react-native-navigation/issues/4757#issuecomment-468133753

Please check out the workaround.

after editing it this happened to me

Build file 'D:\projects\feb\android\app\build.gradle' line: 1

  • What went wrong:
    A problem occurred evaluating project ':app'.
    > Failed to apply plugin [id 'com.android.application']
    > Minimum supported Gradle version is 4.10.1. Current version is 4.4. If using the gradle wrapper, try editing the distributionUrl in D:\projects\feb\android\gradle\wrapper\gradle-wrapper.properties to gradle-4.10.1-all.zip

For me this issue was resolved just after I run my project from Android studio

the same problem when updating to v0.59.1, I could solve it by updating gradle and the compilation version to 28.

in /android/build.gradle

buildscript {
ext {
minSdkVersion = 21
compileSdkVersion = 28
targetSdkVersion = 26
supportLibVersion = "28.0.0"
playServicesVersion = "15.0.1"
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
}
}

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"
}
maven {
url 'https://maven.google.com'
}
}
configurations.all {
resolutionStrategy.force "com.android.support:support-v4:${rootProject.ext.supportLibVersion}"
}
}

in /android/gradle/wrapper/gradle-wrapper.properties

distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip

bug1
ERROR: Could not get unknown property 'mergeResourcesProvider' for object of type com.android.build.gradle.internal.api.ApplicationVariantImpl.

Was this page helpful?
0 / 5 - 0 ratings