Could not find method google() for arguments [] on repository container.

2020-05-13 09:56:35

参考地址 Could not find method google() for arguments [] on repository container.

问题:

在react native中安装realm数据库后运行react-native run-android 时报如下错:




开发环境:


react-native:^0.55.4


reaml:^2.27.0


解决方案:

1、打开项目根目录下android/gradle/wrapper/gradle-wrapper.properties


将distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip中的2.14.1改成4.1




2、打开项目根目录下的android/build.gradle


1)、在buildscript和allprojects下的repositories分别添加google()


2)、将dependencies中的classpath 'com.android.tools.build:gradle:2.2.3'中的2.2.3【具体看自己的是多少】改成3.0.1




重新运行编译项目命令,要下载新的gradle,这个过程有点慢。至此,问题已解决!



  • 2020-04-01 10:21:20

    Vue extend $mount 构造器详解

    本节介绍两个 Vue.js 内置但却不常用的 API——extend 和 $mount,它们经常一起使用。不常用,是因为在业务开发中,基本没有它们的用武之地,但在独立组件开发时,在一些特定的场景它们是至关重要的。

  • 2020-04-01 15:36:52

    CSS3中的transition属性详解

    transition: property duration timing-function delay transition属性是个复合属性,她包括以下几个子属性: transition-property :规定设置过渡效果的css属性名称 transition-duration :规定完成过渡效果需要多少秒或毫秒 transition-timing-function :指定过渡函数,规定速度效果的速度曲线 transition-delay :指定开始出现的延迟时间

  • 2020-04-02 17:02:25

    vue怎么能像jquery那样获得数据

    有时候我们需要获得动态的元素,但是我们没法直接用vue语法,vue一共了当前组件的对象,我们可以避免使用document.get...之类的。