“无法获得类型为com.android.build.gradle.internal.api.ApplicationVariantImpl的对象的未知属性'mergeResourcesProvider'." [英] "Could not get unknown property 'mergeResourcesProvider' for object of type com.android.build.gradle.internal.api.ApplicationVariantImpl."

查看:291
本文介绍了“无法获得类型为com.android.build.gradle.internal.api.ApplicationVariantImpl的对象的未知属性'mergeResourcesProvider'."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

{
  "name": "RNNProject",
  "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.1",
    "react-native-navigation": "^2.15.0"
  },
  "devDependencies": {
    "@babel/core": "7.4.0",
    "@babel/runtime": "7.4.2",
    "babel-jest": "24.5.0",
    "jest": "24.5.0",
    "metro-react-native-babel-preset": "0.53.1",
    "react-test-renderer": "16.8.3"
  },
  "jest": {
    "preset": "react-native"
  }
}

graddle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

Build Graddle
 dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1' }

推荐答案

我通过执行以下步骤解决了此问题:

I resolved this issue by doing the following steps:

  1. 在android/gradle/wrapper/gradle-wrapper.properties中,将distributionUrl值更改为distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip.
  2. 在android/build.gradle中将classpath更改为'com.android.tools.build:gradle:3.3.0'.
  3. *可选(如果使用Metro的话)在项目目录中创建metro.config.js并将中的metro版本正确在您的packge.json文件中.
  4. 删除node_modules文件夹并运行yarn install.
  1. in android/gradle/wrapper/gradle-wrapper.properties change distributionUrl value to distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip.
  2. in android/build.gradle change classpath to 'com.android.tools.build:gradle:3.3.0'.
  3. *Optional (if using Metro) create metro.config.js in your project directory and put this code into it .
  4. *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.
  5. remove node_modules folder and run yarn install.

这篇关于“无法获得类型为com.android.build.gradle.internal.api.ApplicationVariantImpl的对象的未知属性'mergeResourcesProvider'."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆