"could Not Get Unknown Property 'mergeresourcesprovider' For Object Of Type Com.android.build.gradle.internal.api.applicationvariantimpl."
{ 'name': 'RNNProject', 'version': '0.0.1', 'private': true, 'scripts': { 'start': 'node node_modules/react-native/local-cli/cli.js start', 'test': 'jest' }, 'd
Solution 1:
I resolved this issue by doing the following steps:
- in android/gradle/wrapper/gradle-wrapper.properties change
distributionUrl
value todistributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
. - in android/build.gradle change
classpath
to'com.android.tools.build:gradle:3.3.0'
. - *Optional (if using Metro) create metro.config.js in your project directory and put this code into it .
- *Optional (if using Metro) And make sure version of metro in package.json
"metro-react-native-babel-preset": "0.51.0"
is right in your packge.json file. - remove node_modules folder and run
yarn install
.
Solution 2:
This happens when you have react native version updated but your project code is not compatible with react native version.
So you need to do changes manually. You can do it by using react-native upgrade helper
https://react-native-community.github.io/upgrade-helper
Specify your current react-native version and the version would you like to update. You can see the changes that need to be done
Attaching screenshot for help
Solution 3:
Resolved my issue by following these steps
- Remove
node_modules
andpackage-lock.json/yarn.lock
. - Set
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
ingradle-wrapper.properties
- Add classpath(
com.android.tools.build:gradle:3.4.0
) inandroid/build.gradle
underbuildscript.dependencies
. - Run
yarn
.
You may run into other errors due to gradle upgrade which needs to be resolved.
Solution 4:
Extra to Omar Al-Howeiti's answer.
Add android:usesCleartextTraffic="true" to AndroidManifest.xml
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:allowBackup="false"
android:usesCleartextTraffic="true"
android:theme="@style/AppTheme">
Post a Comment for ""could Not Get Unknown Property 'mergeresourcesprovider' For Object Of Type Com.android.build.gradle.internal.api.applicationvariantimpl.""